add forgejo actions workflow for deploying the static website
All checks were successful
/ build (push) Successful in 10s
All checks were successful
/ build (push) Successful in 10s
This commit is contained in:
parent
916ec2ed35
commit
313c3ff759
1 changed files with 42 additions and 0 deletions
42
.forgejo/workflows/deploy.yaml
Normal file
42
.forgejo/workflows/deploy.yaml
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
TZ: Europe/Berlin
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: alpine:latest
|
||||||
|
steps:
|
||||||
|
- name: Pipeline info
|
||||||
|
run: |
|
||||||
|
echo "Run triggered by ${{ github.event_name }} (${{ github.event.action }}) on ref ${{ github.ref_name }}"
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
run: |
|
||||||
|
apk update
|
||||||
|
# For CI actions.
|
||||||
|
apk add nodejs-current
|
||||||
|
# For website build.
|
||||||
|
apk add tzdata coreutils curl jq git
|
||||||
|
# For uploading.
|
||||||
|
apk add rsync openssh
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Deploy - Prepare keys
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.SSH_DEPLOY_KEY }}" > deploykey.priv
|
||||||
|
chmod 400 deploykey.priv
|
||||||
|
echo "${{ secrets.SSH_KNOWN_HOSTS_FILE }}" > ./known_hosts
|
||||||
|
|
||||||
|
- name: Deploy - Upload to prod
|
||||||
|
run: |
|
||||||
|
rsync -v -r --delete -e "ssh -i deploykey.priv -o 'UserKnownHostsFile ./known_hosts'" cpu.ccc.de/ cpuccc-website-deploy@public-web-static-intern.hamburg.ccc.de:/var/www/cpu.ccc.de/
|
||||||
Loading…
Add table
Add a link
Reference in a new issue