Skip to content

Commit

Permalink
Fix CI conditional steps
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsarm committed Aug 7, 2024
1 parent 8bd0036 commit 24c5eaa
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ jobs:

- name: Login to Docker Hub
uses: docker/login-action@v3
if: ${{ secrets.DOCKERHUB_TOKEN }}
if: ${{ vars.DOCKERHUB_TOKEN }}
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Install pose
run: |
Expand All @@ -38,8 +40,10 @@ jobs:
run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:$TAG"

- name: Release Docker image
if: ${{ secrets.DOCKERHUB_TOKEN }}
if: ${{ env.DOCKERHUB_TOKEN }}
run: docker push "mrsarm/django-coleman:$TAG"
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get compose.yaml
env:
Expand Down Expand Up @@ -69,8 +73,12 @@ jobs:
run: docker compose -f ci.yaml run dcoleman-e2e

- name: Tag "latest"
if: ${{ secrets.DOCKERHUB_TOKEN && github.ref == 'refs/heads/master' }}
if: ${{ env.DOCKERHUB_TOKEN && github.ref == 'refs/heads/master' }}
run: docker tag "mrsarm/django-coleman:$TAG" mrsarm/django-coleman:latest
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Release "latest"
if: ${{ secrets.DOCKERHUB_TOKEN && github.ref == 'refs/heads/master' }}
if: ${{ env.DOCKERHUB_TOKEN && github.ref == 'refs/heads/master' }}
run: docker push mrsarm/django-coleman:latest
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

0 comments on commit 24c5eaa

Please sign in to comment.