Skip to content

Commit

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

- name: Login to Docker Hub
uses: docker/login-action@v3
if: ${{ secrets.DOCKERHUB_TOKEN }}
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -37,6 +38,7 @@ jobs:
run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:$TAG"

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

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

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

0 comments on commit 8bd0036

Please sign in to comment.