-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from gitcoinco/2683-id-staking-workflow
feat: deployment workflow
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Release and Deploy | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
commit: | ||
description: "Leave blank to use current HEAD, or provide an override commit SHA" | ||
type: string | ||
required: false | ||
|
||
jobs: | ||
ref: | ||
name: Load Commit Ref | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: ref | ||
uses: passportxyz/gh-workflows/.github/actions/load_commit_ref@main | ||
with: | ||
commit: ${{ inputs.commit }} | ||
outputs: | ||
version_tag: ${{ steps.ref.outputs.version_tag }} | ||
docker_tag: ${{ steps.ref.outputs.docker_tag }} | ||
refspec: ${{ steps.ref.outputs.refspec }} | ||
|
||
push_to_staging: | ||
name: Push to Staging | ||
needs: ref | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Push to Staging Branch | ||
uses: passportxyz/gh-workflows/.github/actions/push-to-branch@main | ||
with: | ||
commit: ${{ needs.ref.outputs.refspec }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: "staging-app" | ||
|
||
outputs: | ||
deployed-commit: ${{ steps.push-to-branch.outputs.deployed-commit }} | ||
|
||
wait_for_production_approval: | ||
name: Production Approval Pending | ||
needs: [ref, push_to_staging] | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
- name: Approve Release to Production | ||
run: | | ||
echo "Approved Production Release for: " ${{ needs.ref.outputs.version_tag }} | ||
echo "Ref: ${{ needs.ref.outputs.refspec }}" | ||
push_to_production: | ||
name: Push to Production | ||
needs: [ref, wait_for_production_approval] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Push to Production Branch | ||
uses: passportxyz/gh-workflows/.github/actions/push-to-branch@main | ||
with: | ||
commit: ${{ needs.ref.outputs.refspec }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: "production-app" | ||
|
||
outputs: | ||
deployed-commit: ${{ steps.push-to-branch.outputs.deployed-commit }} | ||
|
||
deployment_info: | ||
name: Display Deployment Information | ||
needs: [ref, push_to_staging, push_to_production] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Show Deployment Details | ||
run: | | ||
echo "Version Tag: ${{ needs.ref.outputs.version_tag }}" | ||
echo "Docker Tag: ${{ needs.ref.outputs.docker_tag }} |