Skip to content

Commit

Permalink
feat: Make update-workflow trigger from Issue Comment
Browse files Browse the repository at this point in the history
  • Loading branch information
elwinschmitz committed Nov 22, 2023
1 parent af0a521 commit 85b8abb
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/poc-deploy-private-faq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ name: 'POC: Private FAQ [staging]'

on:
workflow_dispatch:
issue_comment:
types: [created]

jobs:
build_and_deploy_job:
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
build_and_deploy:
if: >
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'issue_comment' &&
github.event.issue.number == vars.GHA_DEPLOY_TRIGGER_ISSUE &&
contains(github.event.issue.assignees.*.login, github.event.comment.user.login) &&
github.event.comment.body == '/update private-faq'
)
runs-on: ubuntu-latest
name: Build and Deploy Job
name: Build and Deploy
environment: 'staging-faq'
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -91,16 +100,3 @@ jobs:
skip_app_build: true
skip_api_build: true
deployment_environment: 'private'

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
environment: 'staging-faq'
steps:
- name: Close Pull Request for Staging
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WHITE_ROCK_069A8B403 }}
action: 'close'
deployment_environment: 'private'

0 comments on commit 85b8abb

Please sign in to comment.