Adding publish to docker

This commit is contained in:
Borales 2019-10-14 00:12:01 +02:00
parent 05b6c81cc1
commit 60b50482c5
No known key found for this signature in database
GPG Key ID: CDC05EA9067B0EB5
3 changed files with 23 additions and 83 deletions

83
.github/main.workflow vendored
View File

@ -1,83 +0,0 @@
workflow "Pull Request" {
on = "pull_request"
resolves = ["Docker Lint [PR]", "Shell Lint [PR]", "Test [PR]"]
}
action "Docker Lint [PR]" {
uses = "docker://replicated/dockerfilelint"
args = "Dockerfile"
}
action "Shell Lint [PR]" {
uses = "actions/bin/shellcheck@master"
args = "entrypoint.sh"
}
action "Test [PR]" {
uses = "actions/bin/bats@master"
args = "test/*.bats"
}
workflow "Build and Publish" {
resolves = [
"Docker Lint",
"Test",
"Docker Login",
"Docker Publish",
]
on = "push"
}
action "Master Branch" {
uses = "actions/bin/filter@master"
args = "branch master"
}
action "Docker Lint" {
uses = "docker://replicated/dockerfilelint"
needs = ["Master Branch"]
args = "Dockerfile"
}
action "Shell Lint" {
uses = "actions/bin/shellcheck@master"
needs = ["Master Branch"]
args = "entrypoint.sh"
}
action "Test" {
uses = "actions/bin/bats@master"
needs = ["Master Branch"]
args = "test/*.bats"
}
action "Build" {
uses = "actions/docker/cli@master"
needs = [
"Docker Lint",
"Test",
"Shell Lint",
]
args = "build -t yarn ."
}
action "Docker Tag" {
uses = "actions/docker/tag@master"
args = "yarn borales/yarn --no-latest"
needs = ["Build"]
}
action "Docker Login" {
uses = "actions/docker/login@master"
secrets = ["DOCKER_PASSWORD", "DOCKER_USERNAME"]
needs = ["Build"]
}
action "Docker Publish" {
uses = "actions/docker/cli@master"
needs = [
"Docker Login",
"Docker Tag",
]
args = "push borales/yarn"
}

21
.github/workflows/docker-publish.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Publish Docker image
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: borales/yarn
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
cache: true

View File

@ -22,6 +22,8 @@ jobs:
cmd: install
```
> `cmd` value will be used as a command for Yarn
### Secrets
* `NPM_AUTH_TOKEN` - **Optional**. The token to use for authentication with the npm registry. Required for `yarn publish` ([more info](https://docs.npmjs.com/getting-started/working_with_tokens))