-
Notifications
You must be signed in to change notification settings - Fork 76
74 lines (64 loc) · 2.21 KB
/
gh-pages-pr-remove.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: GH-Pages PR Remove Deploy
on:
workflow_run:
workflows: ["GH-Pages PR Remove"]
types:
- completed
env:
ROOT_DIR: './public.old'
jobs:
remove:
name: PR Remove Deploy
concurrency:
group: gh-pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Setup repository
uses: actions/checkout@v3
- name: install SiteSpawner package
run: |
python3 -m venv .venv
.venv/bin/python3 -m pip install tools/SiteSpawner
source .venv/bin/activate
echo "PATH=$PATH" >> $GITHUB_ENV
python3 -m pip install tools/SiteSpawner
- name: Download deployment
uses: actions/checkout@v3
with:
ref: gh-pages
path: ${{ env.ROOT_DIR }}
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
name: delete_pr_number
path: ./
run_id: ${{ github.event.workflow_run.id }}
- name: Extract PR number
id: PR
run: |
cat delete_pr_number.txt | tee "$GITHUB_OUTPUT"
rm -rf delete_pr_number.txt
- name: Update the webpage
run: |
rm -rf ${{ env.ROOT_DIR }}/html/dev/${{ steps.PR.outputs.number }}
rm -rf ${{ env.ROOT_DIR }}/doctrees/dev/${{ steps.PR.outputs.number }}
mkdir -p public.new/html/dev/${{ steps.PR.outputs.number }}/docs_rendered
cp -arf ./docs_rendered/* public.new/html/dev/${{ steps.PR.outputs.number }}/docs_rendered
sis -d webpage \
--include-documentation \
--doc-project-name "Cores VeeR EL2" \
--loc-github-ref-name ${{ github.ref_name }} \
--loc-github-event-name ${{ github.event_name }} \
--pr-number ${{ steps.PR.outputs.number }}
- name: Add redirect index page
run: |
cp .github/scripts/indexgen/index_redirect/index.html ./public.new/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public.new
commit_message: "Remove reports from PR#${{ steps.PR.outputs.number }}"