Skip to content

Commit 66e299b

Browse files
committed
add docker-build/push to CI
1 parent 3282252 commit 66e299b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,30 @@ jobs:
126126
user: __token__
127127
password: ${{ secrets.PYPI_API_TOKEN }}
128128
verbose: true # For debugging 'twine upload' if a problem occurs.
129+
130+
deploy_docker:
131+
needs: tests
132+
if: ${{ success() && (contains(github.ref, 'refs/tags') || github.ref == 'refs/heads/master') }}
133+
runs-on: ubuntu-latest
134+
steps:
135+
- uses: actions/checkout@v2
136+
with:
137+
fetch-depth: "0"
138+
- name: Get Tag Version
139+
id: version
140+
shell: bash
141+
run: |
142+
if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then
143+
echo "::set-output name=TAG_VERSION::latest"
144+
else
145+
echo "::set-output name=TAG_VERSION::${GITHUB_REF##*/}"
146+
fi
147+
- name: Login to DockerHub
148+
uses: docker/login-action@v1
149+
with:
150+
username: ${{ secrets.DOCKERHUB_USERNAME }}
151+
password: ${{ secrets.DOCKERHUB_TOKEN }}
152+
- name: Build Docker
153+
run: make APP_VERSION=${{ steps.version.outputs.TAG_VERSION }} docker-build
154+
- name: Push to DockerHub
155+
run: make APP_VERSION=${{ steps.version.outputs.TAG_VERSION }} docker-push

0 commit comments

Comments
 (0)