Skip to content

Commit

Permalink
create release only if image was pushed
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Mar 6, 2024
1 parent 686ea4a commit 9a2e47e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/cd-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
- id: push
uses: docker/build-push-action@v5
with:
context: modules
file: modules/api/Dockerfile
Expand All @@ -73,7 +74,7 @@ jobs:
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.meta.outputs.version || 'latest' }}
- if: startsWith(github.ref, 'refs/tags/api/v')
- if: steps.push.outcome == 'success' && startsWith(github.ref, 'refs/tags/api/v')
uses: softprops/action-gh-release@v1
with:
body: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/cd-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
- id: push
uses: docker/build-push-action@v5
with:
context: modules
file: modules/auth/Dockerfile
Expand All @@ -73,7 +74,7 @@ jobs:
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.meta.outputs.version || 'latest' }}
- if: startsWith(github.ref, 'refs/tags/auth/v')
- if: steps.push.outcome == 'success' && startsWith(github.ref, 'refs/tags/auth/v')
uses: softprops/action-gh-release@v1
with:
body: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/cd-metrics-scraper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
- id: push
uses: docker/build-push-action@v5
with:
context: modules
file: modules/metrics-scraper/Dockerfile
Expand All @@ -73,7 +74,7 @@ jobs:
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.meta.outputs.version || 'latest' }}
- if: startsWith(github.ref, 'refs/tags/metrics-scraper/v')
- if: steps.push.outcome == 'success' && startsWith(github.ref, 'refs/tags/metrics-scraper/v')
uses: softprops/action-gh-release@v1
with:
body: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/cd-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
- id: push
uses: docker/build-push-action@v5
with:
context: .
file: modules/web/Dockerfile
Expand All @@ -73,7 +74,7 @@ jobs:
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.meta.outputs.version || 'latest' }}
- if: startsWith(github.ref, 'refs/tags/web/v')
- if: steps.push.outcome == 'success' && startsWith(github.ref, 'refs/tags/web/v')
uses: softprops/action-gh-release@v1
with:
body: |
Expand Down

0 comments on commit 9a2e47e

Please sign in to comment.