Skip to content

0.0.26

0.0.26 #29

Workflow file for this run

name: docker-release
on:
release:
types: [published]
jobs:
build-and-push:
strategy:
matrix:
image: [
{ name: "divviup_api", rust_features: "default" },
{ name: "divviup_api_integration_test", rust_features: "integration-testing" },
]
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: git
run: echo "GIT_REVISION=$(git describe --always --dirty=-modified)" >> $GITHUB_OUTPUT
- id: get_version
run: echo VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
use: true
- id: gcp-auth
name: Authenticate to GCP
uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ vars.GCP_ARTIFACT_PUBLISHER_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.GCP_ARTIFACT_PUBLISHER_LOAD_GEN_SERVICE_ACCOUNT }}
token_format: access_token
access_token_lifetime: "3600s"
access_token_scopes: https://www.googleapis.com/auth/cloud-platform
- uses: docker/login-action@v3
with:
registry: us-west2-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.gcp-auth.outputs.access_token }}
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: "us-west2-docker.pkg.dev/janus-artifacts/divviup-api/${{ matrix.image.name }}:${{ steps.get_version.outputs.VERSION }}"
build-args: |
GIT_REVISION=${{ steps.git.outputs.GIT_REVISION }}
RUST_FEATURES=${{ matrix.image.rust_features }}
cache-from: |
type=gha,scope=main-${{ matrix.image.rust_features }}