Build & Push EVM Gateway Image to Public Repo #313
This file contains hidden or 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: "Build & Push EVM Gateway Image to Public Repo" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Git tag to build. Also used as the docker image tag.' | |
| required: true | |
| type: string | |
| 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 | |
| ref: ${{ inputs.tag }} | |
| - 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 --build-arg VERSION="${{ inputs.tag }}" --build-arg ARCH=amd64 -t ${{ env.DOCKER_IMAGE_URL }}:${{ inputs.tag }} --file Dockerfile . | |
| docker push ${{ env.DOCKER_IMAGE_URL }}:${{ inputs.tag }} |