Skip to content

Use the released tag version to identify newly-created docker images #185

Use the released tag version to identify newly-created docker images

Use the released tag version to identify newly-created docker images #185

Workflow file for this run

name: "Build & Push EVM Gateway Image to Public Repo"
on:
pull_request:
push:
branches:
- "main"
env:
DOCKER_IMAGE_URL: ${{ vars.REPO_DOCKER_IMAGE_URL }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set Gateway Version
id: set_version
run: echo "GATEWAY_VERSION=$(git describe --tags --abbrev=0 2>/dev/null)" >> $GITHUB_OUTPUT
- name: Google auth
id: auth
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: ${{ vars.GHA_IDENTITY_POOL }}
service_account: ${{ vars.REPO_SERVICE_ACCOUNT }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ vars.GAR_PROJECT_ID }}
- name: Docker Auth
run: |-
gcloud auth configure-docker ${{ vars.GAR_LOCATION }}-docker.pkg.dev
docker build -t ${{ env.DOCKER_IMAGE_URL }}:${{ steps.set_version.outputs.GATEWAY_VERSION }} --build-arg GATEWAY_VERSION=${{ steps.set_version.outputs.GATEWAY_VERSION }} --file Dockerfile .