Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
This commit is contained in:
parent
52382d65e3
commit
45b311c638
3 changed files with 13 additions and 13 deletions
35
.forgejo/workflows/jekyll_cleanup.yml
Normal file
35
.forgejo/workflows/jekyll_cleanup.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
name: Jekyll cleanup
|
||||
|
||||
# only trigger on pull request closed events
|
||||
on:
|
||||
pull_request:
|
||||
types: [ closed ]
|
||||
|
||||
env:
|
||||
WEB_HOST: webforge.of.tahoe-lafs.org
|
||||
WEB_USER: www
|
||||
WEB_ROOT: /var/www/preview
|
||||
WEB_CONTEXT: "/${{ forge.event.pull_request.number }}/"
|
||||
jobs:
|
||||
jekyll_cleanup:
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
pull-requests: write
|
||||
actions: read
|
||||
contents: read
|
||||
steps:
|
||||
- name: Install requirements
|
||||
id: install_requirements
|
||||
run: |
|
||||
apt-get -q update
|
||||
apt-get -q install -y lftp
|
||||
apt-get -q clean
|
||||
- name: Cleanup Jeyll preview
|
||||
id: cleanup_preview
|
||||
run: |
|
||||
# Prepare ssh key
|
||||
echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
# Delete preview context from the remote site
|
||||
echo -e "set sftp:connect-program ssh -a -x -o StrictHostKeyChecking=no; rm -r -f ${WEB_ROOT}${WEB_CONTEXT}\nbye" \
|
||||
| lftp sftp://${WEB_USER}:unused@${WEB_HOST}
|
Loading…
Add table
Add a link
Reference in a new issue