This commit is contained in:
parent
4cb43c883c
commit
d2fb1a8622
4 changed files with 151 additions and 0 deletions
33
.forgejo/workflows/cleanup.yaml
Normal file
33
.forgejo/workflows/cleanup.yaml
Normal file
|
@ -0,0 +1,33 @@
|
|||
on:
|
||||
pull_request:
|
||||
types: [ closed, merged ]
|
||||
|
||||
jobs:
|
||||
cleanup:
|
||||
runs-on: x86_64
|
||||
container:
|
||||
image: alpine:latest
|
||||
steps:
|
||||
- name: Environment setup
|
||||
run: |
|
||||
apk add git nodejs jq coreutils curl tree gawk grep
|
||||
- name: Public repo pull
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.PAGES_TOKEN }}
|
||||
ref: public
|
||||
- name: Render website
|
||||
run: |
|
||||
export GITHUB_PR_NAME=$(grep -l ${{ github.sha }} previews/*/git_sha.txt | awk -F '/' '{print $2}')
|
||||
echo $GITHUB_PR_NAME >> $GITHUB_ENV
|
||||
rm -rf previews/$GITHUB_PR_NAME || true
|
||||
cd previews
|
||||
tree -d -H '.' -L 1 --noreport --charset utf-8 -T "Versions" -o index.html
|
||||
- name: Website upload
|
||||
run: |
|
||||
git config user.name "forgejo-actions[bot]"
|
||||
git config user.email "dev@ayakael.net"
|
||||
git add .
|
||||
git commit -m "Clean-up $GITHUB_PR_NAME"
|
||||
git push
|
Loading…
Add table
Add a link
Reference in a new issue