-
Notifications
You must be signed in to change notification settings - Fork 44
50 lines (42 loc) · 1.4 KB
/
docs-teardown.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# copy this workflow into your repo
name: "Documentation Teardown"
on:
pull_request_target:
branches:
- "4.4"
- "5.x"
- "dev"
types:
- closed
jobs:
teardown-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: lts/*
- id: get-deploy-url
env:
ORG: ${{ github.event.repository.owner.login }}
REPO: ${{ github.event.repository.name }}
DEPLOYID: ${{ github.event.pull_request.number }}
run: |
deployurl=$ORG-$REPO-$DEPLOYID.surge.sh
echo "deploy-url=$deployurl" >> $GITHUB_OUTPUT
- name: Teardown documentation
shell: bash
env:
SURGE_TOKEN: "${{ secrets.DOCS_SURGE_TOKEN }}"
DEPLOY_URL: ${{ steps.get-deploy-url.outputs.deploy-url }}
run: |
npm install -g surge
surge teardown $DEPLOY_URL --token "$SURGE_TOKEN"
- name: Comment on PR
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd # v2.8.0
with:
number: ${{ github.event.pull_request.number }}
header: docs-pr-changes
message: |
Thanks for the documentation updates.
The preview documentation has now been torn down - reopening this PR will republish it.
GITHUB_TOKEN: ${{ secrets.DOCS_PR_COMMENT_TOKEN }}