This commit is contained in:
parent
d4f7f08f0e
commit
df1d18d238
3 changed files with 27 additions and 15 deletions
25
.forgejo/workflows/deploy.yml
Normal file
25
.forgejo/workflows/deploy.yml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
runs-on: ipv6
|
||||||
|
env:
|
||||||
|
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
|
||||||
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
RSYNC_DEST: ${{ secrets.RSYNC_DEST }}
|
||||||
|
steps:
|
||||||
|
- uses: https://code.forgejo.org/actions/checkout@v4
|
||||||
|
- name: upload
|
||||||
|
run: |
|
||||||
|
apt-get install --yes --no-install-recommends rsync
|
||||||
|
echo "$SSH_KNOWN_HOSTS" > /ssh_known_hosts
|
||||||
|
echo "$SSH_PRIVATE_KEY" > /ssh_private_key
|
||||||
|
chmod 0600 /ssh_private_key
|
||||||
|
rsync -v --recursive --delete -e "ssh -oUserKnownHostsFile=/ssh_known_hosts -i /ssh_private_key" "schedules/" "$RSYNC_DEST"
|
||||||
|
|
10
Makefile
10
Makefile
|
@ -1,10 +0,0 @@
|
||||||
OUTPUT_DIR = .
|
|
||||||
|
|
||||||
SSH_HOST = fahrplan.cosin.ch
|
|
||||||
SSH_USER = webcosin
|
|
||||||
TARGET_DIR = /srv/www/fahrplan.cosin.ch/fahrplan/
|
|
||||||
|
|
||||||
.PHONY: upload
|
|
||||||
|
|
||||||
upload:
|
|
||||||
rsync --rsh=ssh -P -rvzc --cvs-exclude --delete --exclude=Makefile $(OUTPUT_DIR)/ $(SSH_USER)@$(SSH_HOST):$(TARGET_DIR)
|
|
|
@ -8,8 +8,5 @@ one directory per year.
|
||||||
Deployment
|
Deployment
|
||||||
----------
|
----------
|
||||||
|
|
||||||
Given the necessary _ssh_ login credentials, just run:
|
The `master` branch is deployed to https://fahrplan.cosin.ch automatically via
|
||||||
|
Forgejo Actions.
|
||||||
make upload
|
|
||||||
|
|
||||||
to upload the static schedule information to our webserver via _rsync_ over _ssh_.
|
|
||||||
|
|
Loading…
Reference in a new issue