Skip to content

fix: update ENV comments in Dockerfile (#22) #5

fix: update ENV comments in Dockerfile (#22)

fix: update ENV comments in Dockerfile (#22) #5

name: Build and publish fee-withdrawer-v2 image
on:
push:
branches:
- "main"
tags:
- "*"
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: [matterlabs-ci-runner]
steps:
- uses: actions/checkout@v2
- 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@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Generate build ID for Flux Image Automation
id: tag
if: ${{ startsWith(github.ref, 'refs/tags') }}
run: |
echo "BUILD_ID=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
- name: Generate build ID for Flux Image Automation
id: build
if: ${{ !startsWith(github.ref, 'refs/tags') }}
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:
push: true
tags: |
"matterlabs/fee-withdrawer-v2:latest"
"matterlabs/fee-withdrawer-v2:${{ steps.tag.outputs.BUILD_ID }}"
"us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2:latest"
"us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2:${{ steps.tag.outputs.BUILD_ID }}"
file: Dockerfile
no-cache: true
- name: Build and push Docker image
uses: docker/build-push-action@v5
if: ${{ !startsWith(github.ref, 'refs/tags') }}
with:
push: true
tags: |
"matterlabs/fee-withdrawer-v2:latest"
"matterlabs/fee-withdrawer-v2:${{ steps.build.outputs.BUILD_ID }}"
"us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2:latest"
"us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2:${{ steps.build.outputs.BUILD_ID }}"
file: Dockerfile
no-cache: true