3333 type : string
3434 pull_request :
3535 branches :
36- - " *"
36+ - " ** "
3737 push :
3838 branches :
3939 - " main"
4040
4141env :
4242 FRONT_DOOR_USERNAME : ${{ secrets.FRONT_DOOR_USERNAME }}
4343 FRONT_DOOR_PASSWORD : ${{ secrets.FRONT_DOOR_PASSWORD }}
44- GITHUB_PR_NUMBER : ${{ github.event.pull_request.number }}
44+ GITHUB_PR_NUMBER : ${{ github.event.pull_request.number }}
4545jobs :
4646 prod-check-branch :
4747 runs-on : ubuntu-24.04
4848 steps :
4949 - name : Output variables
5050 run : |
51- echo "Environment: ${{ inputs.environment }}"
51+ echo "Environment: ${{ inputs.environment || github.event.client_payload.environment }}"
5252 echo "Branch: ${{ github.ref }}"
5353 - name : Checks to see that main branch is selected if deploying to prod
5454 if : ${{ inputs.environment == 'prod' && github.ref != 'refs/heads/main' }}
@@ -65,14 +65,33 @@ jobs:
6565 docs_source_path : " public"
6666 docs_build_path : " ./"
6767 doc_type : " hugo"
68- environment : ${{inputs.environment}}
68+ environment : ${{ inputs.environment || github.event.client_payload.environment }}
6969 force_hugo_theme_version : ${{inputs.hugo_theme_override}}
7070 auto_deploy_branch : " main"
7171 auto_deploy_env : " prod"
7272 secrets :
7373 AZURE_CREDENTIALS : ${{secrets.AZURE_CREDENTIALS_DOCS}}
7474 AZURE_KEY_VAULT : ${{secrets.AZURE_KEY_VAULT_DOCS}}
7575
76+ trigger-theme-slack-notification :
77+ if : github.event_name == 'repository_dispatch'
78+ needs : call-docs-build-push
79+ runs-on : ubuntu-latest
80+ permissions : read-all
81+ steps :
82+ - name : Trigger 'Slack notification for new theme release' workflow in 'nginx-hugo-theme' repo.
83+ run : |
84+ curl -L \
85+ -X POST \
86+ -H "Accept: application/vnd.github+json" \
87+ -H "Authorization: Bearer ${{ secrets.THEME_SLACK_FLOW_PAT }}" \
88+ -H "X-GitHub-Api-Version: 2022-11-28" \
89+ "https://api.github.com/repos/${{ secrets.OWNER }}/${{ secrets.REPO }}/dispatches" \
90+ -d "{\"event_type\": \"trigger-slack-notification\", \"client_payload\": {\"previewURL\": \"${{ env.PREVIEW_URL }}\", \"author\": \"${{ github.event.client_payload.author}}\", \"tag_name\": \"${{ github.event.client_payload.tag_name }}\", \"release_name\": \"${{ github.event.client_payload.release_name }}\"}}"
91+ env :
92+ PREVIEW_URL : ${{ needs.call-docs-build-push.outputs.PREVIEW_URL }}
93+
94+
7695 lighthouseci :
7796 if : github.event.pull_request
7897 needs : call-docs-build-push
0 commit comments