APT-1605 APT-1616 APT-1621 : Loading splash - add token to wallet - b… #30
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: "CICD zq2-staking" | |
on: | |
# Test run before merging | |
pull_request: | |
branches: | |
- main | |
# On merged | |
push: | |
branches: | |
- main | |
# On released | |
release: | |
types: [published] | |
jobs: | |
build-docker-buildx-stg: | |
permissions: | |
id-token: write | |
contents: write | |
runs-on: ubuntu-22.04 | |
if: github.actor != 'dependabot[bot]' && (github.event_name == 'pull_request' || github.event_name == 'push') && github.ref_name == 'main' | |
name: "Deploy image STG" | |
strategy: | |
fail-fast: false | |
matrix: | |
application: | |
[ | |
zq2-staking/zq2-staking-frontend, | |
] | |
include: | |
- application: zq2-staking/zq2-staking-frontend | |
image_name: zq2-staking-frontend | |
file: images/frontend/Dockerfile | |
context: . | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: "true" | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
fetch-depth: 0 | |
- name: Docker build and push | |
uses: Zilliqa/gh-actions-workflows/actions/ci-dockerized-app-build-push@v2 | |
with: | |
file: ${{ matrix.file }} | |
context: ${{ matrix.context }} | |
push: ${{ github.ref_name == github.event.repository.default_branch }} | |
tag: asia-docker.pkg.dev/prj-d-devops-services-4dgwlsse/zilliqa-private/${{ matrix.image_name }} | |
tag-length: 8 | |
tag-latest: false | |
registry: asia-docker.pkg.dev | |
workload-identity-provider: "${{ secrets.GCP_PRD_GITHUB_WIF }}" | |
service-account: "${{ secrets.GCP_STG_GITHUB_SA_DOCKER_REGISTRY }}" | |
cache-key: asia-docker.pkg.dev/prj-d-devops-services-4dgwlsse/zilliqa-private/${{ matrix.image_name }}-cache | |
build-args: | | |
DEPLOY_ENV=stg | |
build-docker-buildx-prd: | |
permissions: | |
id-token: write | |
contents: write | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'release' | |
name: "Deploy image PRD" | |
strategy: | |
fail-fast: false | |
matrix: | |
application: | |
[ | |
zq2-staking/zq2-staking-frontend, | |
] | |
include: | |
- application: zq2-staking/zq2-staking-frontend | |
image_name: zq2-staking-frontend | |
file: images/frontend/Dockerfile | |
context: . | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: "true" | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
fetch-depth: 0 | |
- name: Docker build and push | |
uses: Zilliqa/gh-actions-workflows/actions/ci-dockerized-app-build-push@v2 | |
with: | |
file: ${{ matrix.file }} | |
context: ${{ matrix.context }} | |
push: true | |
tag: asia-docker.pkg.dev/prj-p-devops-services-tvwmrf63/zilliqa-private/${{ matrix.image_name }}:${{ github.ref_name }} | |
tag-latest: true | |
registry: asia-docker.pkg.dev | |
workload-identity-provider: "${{ secrets.GCP_PRD_GITHUB_WIF }}" | |
service-account: "${{ secrets.GCP_PRD_GITHUB_SA_DOCKER_REGISTRY }}" | |
cache-key: asia-docker.pkg.dev/prj-p-devops-services-tvwmrf63/zilliqa-private/${{ matrix.image_name }}-cache | |
build-args: | | |
DEPLOY_ENV=prd |