Merge Queue Monitor - Stack commits (#62) #60
Workflow file for this run
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: releaseCtrlplaneApi | |
on: | |
push: | |
branches: | |
- dev | |
- main | |
- feature/sc-2539/artifact-registry-action # TODO: Remove this after PR gets approved. | |
jobs: | |
release-artifact: | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set variables | |
id: vars | |
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Build Docker image | |
run: | | |
docker build -t ctrlplane-api:latest . | |
docker tag ctrlplane-api:latest asia-southeast1-docker.pkg.dev/breu-dev/ctrlplane/ctrlplane-api:latest | |
docker tag ctrlplane-api:latest asia-southeast1-docker.pkg.dev/breu-dev/ctrlplane/ctrlplane-api:${{ steps.vars.outputs.short_sha }} | |
- name: Authenticate with GCP | |
id: auth | |
uses: "google-github-actions/auth@v1" | |
with: | |
token_format: access_token | |
workload_identity_provider: "${{ secrets.GCP_WORLDLOAD_IDENTITY_PROVIDER }}" | |
service_account: "${{ secrets.GCP_SA_NAME }}@${{ secrets.GCP_PROJECT_ID }}.iam.gserviceaccount.com" | |
access_token_lifetime: 300s | |
- name: Login into Google Artifact Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: asia-southeast1-docker.pkg.dev/breu-dev/ctrlplane | |
username: oauth2accesstoken | |
password: ${{ steps.auth.outputs.access_token }} | |
- id: docker-push-tagged | |
name: Tag Docker image and push to Google Artifact Registry | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: | | |
asia-southeast1-docker.pkg.dev/breu-dev/ctrlplane/ctrlplane-api:${{ steps.vars.outputs.short_sha }} | |
asia-southeast1-docker.pkg.dev/breu-dev/ctrlplane/ctrlplane-api:latest |