Dcellar-web-ui prod testnet CICD #17
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: dcellar-web-ui prod testnet CICD | |
on: | |
# temp remove pr trigger | |
# pull_request: | |
# types: | |
# - closed | |
# branches: | |
# - main | |
workflow_dispatch: | |
inputs: | |
project: | |
description: "Release the project manually." | |
required: true | |
default: "dcellar-web-ui" | |
type: string | |
env: | |
description: "Choose the environment for deployment." | |
required: true | |
default: "testnet" | |
type: string | |
ref: | |
description: "Specify the branch, tag or SHA to deploy" | |
required: true | |
default: "main" | |
type: string | |
jobs: | |
pre-check: | |
runs-on: ubuntu-latest | |
if: (github.event.pull_request.merged && (contains(github.event.pull_request.labels.*.name, 'dcellar-web-ui'))) || ((github.event.inputs.project == 'dcellar-web-ui') && (github.event.inputs.env == 'testnet')) | |
outputs: | |
codeowners: ${{ steps.codeowners.outputs.content }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Read codeowners | |
id: codeowners | |
uses: juliangruber/read-file-action@v1 | |
with: | |
path: .github/CODEOWNERS | |
check-codeowners: | |
runs-on: ubuntu-latest | |
needs: [pre-check] | |
if: (!contains(needs.pre-check.outputs.codeowners, github.event.comment.user.login)) | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Create Version Comment | |
uses: peter-evans/create-or-update-comment@v2 | |
with: | |
issue-number: ${{ github.event.issue.number }} | |
comment-id: ${{ github.event.comment.id }} | |
body: | | |
++++++ | |
Please contact codeowners to deploy! | |
reactions: rocket | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CICD: | |
needs: [pre-check] | |
if: (contains(needs.pre-check.outputs.codeowners, github.event.comment.user.login)) | |
uses: node-real/github-workflows/.github/workflows/dcellar-web-ui-prod-testnet-cicd.yml@feat/opt-fe/devin | |
secrets: inherit | |
with: | |
app_name: dcellar-web-ui | |
env: 'testnet' | |
ref: ${{ inputs.ref }} |