ccchh-website/.forgejo/workflows/cleanup.yaml

24 lines
855 B
YAML
Raw Permalink Normal View History

2024-01-20 15:07:28 +01:00
on:
pull_request:
types:
- closed
2024-01-20 15:07:28 +01:00
jobs:
cleanup-staging:
runs-on: docker
container:
image: code.forgejo.org/oci/node:20-bookworm
steps:
- name: Pipeline info PR
run: |
echo "Run triggered by ${{ github.event_name }} (${{ github.event.action }}) on ref ${{ github.ref_name }}"
2024-01-20 15:07:28 +01:00
- name: Staging Deployment - Prepare keys
2024-01-20 15:07:28 +01:00
run: |
echo "${{ secrets.SSH_DEPLOY_KEY }}" > deploykey.priv
chmod 400 deploykey.priv
echo "${{ secrets.SSH_KNOWN_HOSTS_FILE }}" > ./known_hosts
- name: Staging Deployment - Remove PR from staging
run: |
ssh -i deploykey.priv -o 'UserKnownHostsFile ./known_hosts' ccchh-website-deploy@public-web-static-intern.hamburg.ccc.de -t "rm -r /var/www/staging.hamburg.ccc.de/pr${{ github.event.pull_request.number }}/"