Skip to content

Commit

Permalink
Modify docker builder workflow (#108)
Browse files Browse the repository at this point in the history
* modify docker builder workflow

* cleaner main check syntax
  • Loading branch information
MattWellie authored Oct 10, 2023
1 parent 46bf3f7 commit b3523ca
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/deploy_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ jobs:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
DOCKER_IMAGE: australia-southeast1-docker.pkg.dev/cpg-common/images/${{ github.event.inputs.image_name }}:${{ github.event.inputs.image_tag }}
DOCKER_DEV: australia-southeast1-docker.pkg.dev/cpg-common/images-dev/
DOCKER_MAIN: australia-southeast1-docker.pkg.dev/cpg-common/images/
DOCKER_IMAGE: ${{ github.event.inputs.image_name }}:${{ github.event.inputs.image_tag }}
IMAGE_NAME: ${{ github.event.inputs.image_name }}
IMAGE_TAG: ${{ github.event.inputs.image_tag }}

steps:
- name: "Restrict to main"
if: github.ref != 'refs/heads/main'
run: exit 1

- name: "checkout repo"
uses: actions/checkout@v3
Expand All @@ -50,6 +49,14 @@ jobs:
--tag $DOCKER_IMAGE \
images/$IMAGE_NAME
- name: "push image"
- name: "Push non-main branch to dev artifactory"
if: ${{ github.ref_name != 'main' }}
run: |
docker push $DOCKER_IMAGE
docker tag $DOCKER_IMAGE $DOCKER_DEV$DOCKER_IMAGE
docker push $DOCKER_DEV$DOCKER_IMAGE
- name: "Push main branch to core artifactory"
if: ${{ github.ref_name == 'main' }}
run: |
docker tag $DOCKER_IMAGE $DOCKER_MAIN$DOCKER_IMAGE
docker push $DOCKER_MAIN$DOCKER_IMAGE

0 comments on commit b3523ca

Please sign in to comment.