Skip to content

chore(postgresql-dialect): release 0.23.1 (#982) #53

chore(postgresql-dialect): release 0.23.1 (#982)

chore(postgresql-dialect): release 0.23.1 (#982) #53

name: Build and Push Docker Image to Google Artifact Registry
on:
# This allows manual activation of this action for testing.
workflow_dispatch:
push:
tags:
# Automatically build and push Docker image when a release (version) tag is pushed.
- v*
env:
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
IMAGE: pgadapter
GCR_HOSTNAME: gcr.io/cloud-spanner-pg-adapter
jobs:
setup-build-publish-deploy:
name: Setup, Build, and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.CLOUD_SPANNER_PG_ADAPTER_SERVICE_ACCOUNT }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v0'
# Configure docker to use the gcloud command-line tool as a credential helper
- run: gcloud auth configure-docker gcr.io
# Build and Publish the Docker image
- name: Build and Publish
run: |
export TAG=`echo $GITHUB_REF | awk -F/ '{print $NF}'`
echo $TAG
docker buildx create --name multi_platform --use
docker buildx build --platform linux/amd64,linux/arm64 \
. -f build/Dockerfile \
-t "$GCR_HOSTNAME"/"$IMAGE":"$TAG" \
-t "$GCR_HOSTNAME"/"$IMAGE":latest \
--push \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF"
docker buildx build --platform linux/amd64,linux/arm64 \
. -f build/distroless/Dockerfile \
-t "$GCR_HOSTNAME"/"$IMAGE"-distroless:"$TAG" \
-t "$GCR_HOSTNAME"/"$IMAGE"-distroless:latest \
--push \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF"