feat: auto-deployment of master branch
Some checks failed
/ deploy (push) Failing after 15s

This commit is contained in:
s3lph 2024-04-07 14:17:43 +02:00
parent d4f7f08f0e
commit df1d18d238
Signed by: s3lph
GPG key ID: 0AA29A52FB33CFB5
3 changed files with 27 additions and 15 deletions

View 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"

View file

@ -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)

View file

@ -8,8 +8,5 @@ one directory per year.
Deployment
----------
Given the necessary _ssh_ login credentials, just run:
make upload
to upload the static schedule information to our webserver via _rsync_ over _ssh_.
The `master` branch is deployed to https://fahrplan.cosin.ch automatically via
Forgejo Actions.