WIP feat(ci): Add deployment to static web host
Some checks failed
cleanup.yaml / WIP feat(ci): Add deployment to static web host (push) Failing after 0s
Some checks failed
cleanup.yaml / WIP feat(ci): Add deployment to static web host (push) Failing after 0s
TODO: change deploy host
This commit is contained in:
parent
cd6a9f3105
commit
858e6cb9b5
2 changed files with 110 additions and 0 deletions
30
.forgejo/workflows/cleanup.yaml
Normal file
30
.forgejo/workflows/cleanup.yaml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
|
||||
env:
|
||||
TZ: Europe/Berlin
|
||||
STAGING_BASE_PATH: https://docs-staging.c3voc.de/av
|
||||
DEPLOY_TARGET_BASE: c3voc-docs-deploy@public-web-static-intern.hamburg.ccc.de
|
||||
STAGING_BASE_PATH: https://docs-staging.c3voc.de/av
|
||||
STAGING_DEPLOY_PATH: /var/www/docs-staging.c3voc.de/av/
|
||||
|
||||
jobs:
|
||||
cleanup-staging:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: code.forgejo.org/oci/node:22-bookworm
|
||||
steps:
|
||||
- name: Pipeline info PR
|
||||
run: |
|
||||
echo "Run triggered by ${{ github.event_name }} (${{ github.event.action }}) on ref ${{ github.ref_name }}"
|
||||
|
||||
- name: Staging Deployment - Prepare keys
|
||||
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' ${{ env.DEPLOY_TARGET_BASE }} -t "rm -r ${{ env.STAGING_DEPLOY_PATH }}/pr${{ github.event.pull_request.number }}/"
|
||||
Loading…
Add table
Add a link
Reference in a new issue