Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only pushing if merge on main #171

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
build-docker:
name: Build D-Voting Docker images
runs-on: ubuntu-22.04
if: '! github.event.pull_request.draft'
env:
DockerTag: ${{ (github.ref == 'refs/heads/main') && 'latest' || github.head_ref }}
DockerTag: latest
push: ${{ (github.ref == 'refs/heads/main') && 'true' || 'false' }}

steps:
- name: Checkout
Expand All @@ -30,6 +30,7 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
if: ${{ env.push == 'true' }}
uses: docker/login-action@v1
with:
registry: ghcr.io
Expand All @@ -46,21 +47,21 @@ jobs:
REACT_APP_VERSION
REACT_APP_BUILD
REACT_APP_BUILD_TIME
push: true
push: ${{ env.push }}
tags: ghcr.io/c4dt/d-voting-frontend:${{ env.DockerTag }}
- name: Build Backend
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfiles/Dockerfile.backend
platforms: linux/amd64
push: true
push: ${{ env.push }}
tags: ghcr.io/c4dt/d-voting-backend:${{ env.DockerTag }}
- name: Build D-Voting
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfiles/Dockerfile.dela
platforms: linux/amd64
push: true
push: ${{ env.push }}
tags: ghcr.io/c4dt/d-voting-dela:${{ env.DockerTag }}
Loading