Skip to content

GH-Pages PR Remove Deploy #143

GH-Pages PR Remove Deploy

GH-Pages PR Remove Deploy #143

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 }}
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 }}"