Build and publish fee-withdrawer-v2-tee image #23
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: Build and publish fee-withdrawer-v2-tee image | |
on: | |
push: | |
branches: | |
- "gramine*" | |
workflow_dispatch: | |
inputs: | |
target_branch: | |
description: "Target branch to build fee-withdrawer-v2-tee image against" | |
type: string | |
required: true | |
jobs: | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: [matterlabs-ci-runner] | |
steps: | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
with: | |
ref: ${{ github.event.inputs.target_branch }} | |
- uses: actions/checkout@v4 | |
if: ${{ github.event_name != 'workflow_dispatch' }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Generate build ID for Flux Image Automation | |
id: build | |
run: | | |
sha=$(git rev-parse --short HEAD) | |
ts=$(date +%s%N | cut -b1-13) | |
echo "BUILD_ID=${sha}-${ts}" >> "$GITHUB_OUTPUT" | |
- name: Auth to google artifact registry | |
run: | | |
gcloud auth configure-docker us-docker.pkg.dev -q | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
if: ${{ !startsWith(github.ref, 'refs/tags') }} | |
with: | |
context: . | |
push: true | |
tags: | | |
"us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2-tee:latest" | |
"us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2-tee:${{ steps.build.outputs.BUILD_ID }}" | |
file: Dockerfile | |
no-cache: true |