1
0
mirror of synced 2026-01-04 09:06:46 -05:00
Files
docs/.github/workflows/notify-about-deployment.yml

65 lines
2.2 KiB
YAML

name: Notify about production deployment
# **What it does**: Posts a comment on the PR whose merge got into production.
# **Why we have it**: So that the PR author can be informed when their merged PR is in production.
# **Who does it impact**: Writers
on:
workflow_dispatch:
workflow_run:
# Note, we could do this after the "Purge Fastly" finished
workflows: ['Azure Production - Build and Deploy']
types:
- completed
permissions:
contents: read
pull-requests: write
jobs:
find-pr-and-post-comment:
if: ${{ github.repository == 'github/docs-internal' }}
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- uses: ./.github/actions/node-npm-setup
# The "Purge Fastly" action takes about 6 minutes to purge all
# languages. First does the language agnostic URLs, then English,
# then all the other languages.
# So it takes about ~30 seconds until it has sent the purge for
# all English docs.
- name: Sleep a little to give Fastly Purge a chance
run: sleep 30
- name: Find last PR
id: get-number
timeout-minutes: 3
env:
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }}
run: .github/actions-scripts/find-past-built-pr.js
- name: Find content directory changes comment
if: ${{ steps.get-number.outputs.number != '' }}
uses: peter-evans/find-comment@f4499a714d59013c74a08789b48abe4b704364a0
id: findComment
with:
issue-number: ${{ steps.get-number.outputs.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- GONE_TO_PRODUCTION -->'
- name: Update comment
if: ${{ steps.get-number.outputs.number != '' }}
uses: peter-evans/create-or-update-comment@67dcc547d311b736a8e6c5c236542148a47adc3d
with:
comment-id: ${{ steps.findComment.outputs.comment-id }}
issue-number: ${{ steps.get-number.outputs.number }}
body: |
<!-- GONE_TO_PRODUCTION -->
🚀 **This pull request has gone into production!**
The SHA of https://docs.github.com/_build matches the merge commit in this PR.
edit-mode: replace