Skip to content

Commit

Permalink
conditional to docker hub.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Jun 16, 2022
1 parent 8818bc1 commit 39e2d4c
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,35 @@ jobs:
with:
args: 'Adempiere-Vue.zip'

# Check secrets to push image in docker hub registry
check-docker-secrets:
name: Check if docker hub registry information was set on secrets
needs:
- build-app
runs-on: ubuntu-latest
outputs:
is_have_secrets: ${{ steps.check_secret_job.outputs.have_secrets }}
steps:
- id: check_secret_job
run: |
if [[ "${{ secrets.DOCKER_REPO_FRONTEND }}" != "" && \
"${{ secrets.DOCKER_USERNAME }}" != "" && \
"${{ secrets.DOCKER_TOKEN }}" != "" ]]; \
then
echo "Secrets to use a container registry were configured in the repo"
echo "::set-output name=is_have_secrets::true"
else
echo "Secrets to use a container registry were not configured in the repo"
echo "::set-output name=is_have_secrets::false"
fi
# Publish docker image in Docker Hub registry to application
push-imame-dhr:
name: Push Docker image to Docker Hub
needs:
- build-app
- check-docker-secrets
# Skip step based on secret
if: needs.check-docker-secrets.outputs.is_have_secrets == 'true'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
Expand Down

0 comments on commit 39e2d4c

Please sign in to comment.