Crush some noisy logging (#929) #2103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker | |
on: | |
# pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag to use (defaults to "test")' | |
default: "test" | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
VERSION: 1.29.6 | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
DOCKER_BUILDKIT: 1 | |
BUILDKIT_PROGRESS: plain | |
CLOUDSDK_CORE_DISABLE_PROMPTS: 1 | |
IMAGE_NAME: cpg_workflows | |
DOCKER_DEV: australia-southeast1-docker.pkg.dev/cpg-common/images-dev | |
DOCKER_MAIN: australia-southeast1-docker.pkg.dev/cpg-common/images | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- id: "google-cloud-auth" | |
name: "Authenticate to Google Cloud" | |
uses: google-github-actions/auth@v2 | |
with: | |
workload_identity_provider: "projects/1051897107465/locations/global/workloadIdentityPools/github-pool/providers/github-provider" | |
service_account: "gh-images-deployer@cpg-common.iam.gserviceaccount.com" | |
- name: set up gcloud sdk | |
uses: google-github-actions/setup-gcloud@v2 | |
with: | |
project_id: cpg-common | |
- name: gcloud docker auth | |
run: | | |
gcloud auth configure-docker australia-southeast1-docker.pkg.dev | |
- name: build | |
run: | | |
docker build . -f Dockerfile --tag $IMAGE_NAME:${{ github.sha }} | |
- name: push latest | |
if: ${{ github.ref_name == 'main' }} | |
run: | | |
docker tag $IMAGE_NAME:${{ github.sha }} $DOCKER_MAIN/$IMAGE_NAME:$VERSION | |
docker tag $IMAGE_NAME:${{ github.sha }} $DOCKER_MAIN/$IMAGE_NAME:latest | |
docker push $DOCKER_MAIN/$IMAGE_NAME:$VERSION | |
docker push $DOCKER_MAIN/$IMAGE_NAME:latest | |
- name: manually triggered build | |
if: ${{ github.event_name == 'workflow_dispatch' && github.ref_name != 'main' }} | |
run: | | |
docker tag $IMAGE_NAME:${{ github.sha }} $DOCKER_DEV/$IMAGE_NAME:${{github.event.inputs.tag}} | |
docker push $DOCKER_DEV/$IMAGE_NAME:${{github.event.inputs.tag}} |