Add conditions to docker publish

This commit is contained in:
QuantumEntangledAndy committed 2020-07-14 12:18:23 +07:00
1 parent 87ca90528a
commit 39e2391efd
1 file changed
+11
+11
View File
@@ -7,10 +7,21 @@ jobs:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Check token is set
id: vars
shell: bash
run: |
unset HAS_SECRET
if [-n $SECRET]; then HAS_SECRET='true' ; fi
echo ::set-output name=HAS_SECRET_TOKEN::${HAS_SECRET}
env:
SECRET: "${{ secrets.DOCKER_TOKEN }}"
- name: Check out the repo
uses: actions/checkout@v2
if: ${{ steps.vars.outputs.HAS_SECRET }}
- name: Push to Docker Hub
uses: docker/build-push-action@v1
if: ${{ steps.vars.outputs.HAS_SECRET }}
with:
username: thirtythreeforty
password: ${{ secrets.DOCKER_TOKEN }}