Skip to content

refactor: migrate CI/CD to reusable workflow with multi-env deploy #101

refactor: migrate CI/CD to reusable workflow with multi-env deploy

refactor: migrate CI/CD to reusable workflow with multi-env deploy #101

Workflow file for this run

name: Build and Push Staking-api Image
on:
push:
branches:
- 'staging'
- 'main'
jobs:
define-params:
runs-on: ubuntu-latest
outputs:
app_name: staking-api
k8s_ns: staking
image_tag: ${{ github.sha }}
target_environment: ${{ (github.ref_name == 'main') && 'production' || 'staging' }}
steps:
- run: echo "Exposing target environment"
image-build:
needs: define-params
uses: storyprotocol/gha-workflows/.github/workflows/reusable-gcp-image-build-worker.yml@main
with:
app_name: ${{ needs.define-params.outputs.app_name }}
k8s_ns: ${{ needs.define-params.outputs.k8s_ns }}
target_environment: ${{ needs.define-params.outputs.target_environment }}
image_tag: ${{ needs.define-params.outputs.image_tag }}
dockerfile_path: "./Dockerfile"
dockerfile_context: "."
secrets: inherit
request-app-release:
needs: [ define-params, image-build ]
uses: storyprotocol/gha-workflows/.github/workflows/reusable-gcp-app-release-publisher.yml@main
with:
app_name: ${{ needs.define-params.outputs.app_name }}
k8s_ns: ${{ needs.define-params.outputs.k8s_ns }}
target_environment: ${{ needs.define-params.outputs.target_environment }}
image_tag: ${{ needs.define-params.outputs.image_tag }}
secrets: inherit