Skip to content

Dcellar-web-ui prod testnet CICD #23

Dcellar-web-ui prod testnet CICD

Dcellar-web-ui prod testnet CICD #23

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.issue.pull_request.merged && (contains(github.event.issue.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/public-github-workflow/.github/workflows/dcellar-web-ui-prod-testnet-cicd.yml@main
secrets: inherit
with:
app_name: dcellar-web-ui
env: 'testnet'
ref: ${{ inputs.ref }}