Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Splitting build, test and deploy actions
- Loading branch information
Showing
2 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Deploys | ||
|
||
on: | ||
push: | ||
tags: | ||
|
||
jobs: | ||
build-and-test: | ||
# Skip job based on the commit message | ||
if: contains(toJson(github.event.commits), '[skip ci]') == false | ||
name: Deploy Docker images | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Output Docker info | ||
run: docker info | ||
- name: Gets tag as env var if present | ||
run: echo ::set-env name=TAG::${GITHUB_REF#refs/*/} | ||
- name: Output tag if present | ||
run: echo ${TAG} | ||
- name: Build | ||
run: VERSION="${TAG}" make build | ||
- name: Login Docker Hub | ||
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" | ||
env: | ||
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} | ||
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | ||
- name: Deploy new images | ||
run: VERSION="${TRAVIS_TAG}" make release | ||
# - name: Deploy tag latest | ||
# run: VERSION="${TRAVIS_TAG}" make tag_latest | ||
# - name: Deploy release latest | ||
# run: VERSION="${TRAVIS_TAG}" make release_latest |