Skip to content

(fix) Remove spurious line (#1438) #249

(fix) Remove spurious line (#1438)

(fix) Remove spurious line (#1438) #249

name: "ZQ2 image release"
on:
push:
branches:
- 'release/**'
- 'main'
- dl-retry
tags:
- v*
jobs:
release-pub-image:
permissions:
id-token: write
contents: write
if: ${{ github.ref_name != 'main' && github.ref_type == 'tag' }}
runs-on: [ self-hosted, gcp]
env:
GCP_REGISTRY_DOMAIN: asia-docker.pkg.dev
GCP_REGISTRY: asia-docker.pkg.dev/prj-p-devops-services-tvwmrf63/zilliqa-public
steps:
- name: 'Checkout scm'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Configure GCP Credentials"
id: google-auth
uses: "google-github-actions/auth@v2"
with:
token_format: "access_token"
workload_identity_provider: "${{ secrets.GCP_PRD_GITHUB_WIF }}"
service_account: "${{ secrets.GCP_PRD_GITHUB_SA_DOCKER_REGISTRY }}"
create_credentials_file: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to the GCP registry
uses: docker/login-action@v3
with:
registry: ${{ env.GCP_REGISTRY_DOMAIN }}
username: "oauth2accesstoken"
password: "${{ steps.google-auth.outputs.access_token }}"
- name: Build ZQ2 Docker images
run: DOCKER_BUILDKIT=1 docker build --build-arg="is_release=true" -t zilliqa/zq2:${{ github.ref_name }} -t ${{ env.GCP_REGISTRY }}/zq2:${{ github.ref_name }} -f Dockerfile .
shell: bash
- name: Login to the DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Push Docker images to Dockerhub
run: docker push zilliqa/zq2:${{ github.ref_name}}
shell: bash
- name: Push Docker images to GCP
run: docker push ${{ env.GCP_REGISTRY }}/zq2:${{ github.ref_name }}
shell: bash
release-private-image:
permissions:
id-token: write
contents: write
if: ${{ github.ref_name == 'main' }} || ${{ github.ref_name == 'dl-retry' }}
runs-on: [ self-hosted, gcp]
env:
GCP_REGISTRY_DOMAIN: asia-docker.pkg.dev
GCP_REGISTRY: asia-docker.pkg.dev/prj-p-devops-services-tvwmrf63/zilliqa-private
steps:
- name: 'Checkout scm'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get tag version - private image
id: set-tag
uses: Zilliqa/gh-actions-workflows/actions/generate-tag@v2
with:
tag: ${{ env.GCP_REGISTRY }}/zq2
length: 8
- name: "Configure GCP Credentials"
id: google-auth
uses: "google-github-actions/auth@v2"
with:
token_format: "access_token"
workload_identity_provider: "${{ secrets.GCP_PRD_GITHUB_WIF }}"
service_account: "${{ secrets.GCP_PRD_GITHUB_SA_DOCKER_REGISTRY }}"
create_credentials_file: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to the GCP registry
uses: docker/login-action@v3
with:
registry: ${{ env.GCP_REGISTRY_DOMAIN }}
username: "oauth2accesstoken"
password: "${{ steps.google-auth.outputs.access_token }}"
- name: Build ZQ2 Docker images
run: DOCKER_BUILDKIT=1 docker build --build-arg="is_release=true" -t ${{ steps.set-tag.outputs.tags }} -f Dockerfile .
shell: bash
- name: Push Docker images to GCP
run: docker push ${{ steps.set-tag.outputs.tags }}
shell: bash