Skip to content

Commit

Permalink
Push Docker image to Harbor on all pushes during PR
Browse files Browse the repository at this point in the history
  • Loading branch information
VKTB committed Nov 14, 2023
1 parent 698e468 commit 2a65b51
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ jobs:
run: yarn e2e

docker:
# This job triggers only if all the other jobs succeed and does different things depending on the context.
# The job builds the Docker image in all cases and also pushes the image to Harbor only if something is
# pushed to the main or develop branch.
# This job triggers only if all the other jobs succeed. It builds the Docker image and if successful,
# it pushes it to Harbor.
needs: [test]
name: Docker
runs-on: ubuntu-20.04
Expand All @@ -58,10 +57,10 @@ jobs:
with:
images: harbor.stfc.ac.uk/datagateway/scigateway

- name: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') && 'Build and push Docker image to Harbor' || 'Build Docker image' }}
- name: Build and push Docker image to Harbor
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
with:
context: .
push: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 2a65b51

Please sign in to comment.