ese-website/.forgejo/workflows/publish.yaml

44 lines
1.1 KiB
YAML
Raw Normal View History

2024-10-05 12:25:41 +02:00
name: publish
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
2024-10-06 23:06:29 +02:00
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_DEPLOY_PRIVATE_KEY }}
2024-10-07 19:28:01 +02:00
TZ: Europe/Berlin
2024-10-05 12:25:41 +02:00
steps:
2024-10-06 23:06:29 +02:00
- name: checkout
uses: actions/checkout@v4
2024-10-05 12:25:41 +02:00
with:
submodules: recursive
2024-10-06 23:06:29 +02:00
- name: setup node
uses: actions/setup-node@v4
2024-10-05 12:25:41 +02:00
with:
2024-10-06 20:08:18 +02:00
node-version: 'lts/*'
2024-10-05 12:25:41 +02:00
- run: npm ci
- run: npm run build
2024-10-06 23:06:29 +02:00
- name: upload artifact
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
2024-10-05 12:25:41 +02:00
with:
path: _site
2024-10-06 23:06:29 +02:00
- name: deploy
run: |
apt-get update && apt-get install -y rsync
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | ssh-add -
mkdir ~/.ssh
ssh-keyscan ifsr.de > ~/.ssh/known_hosts
year=$(yq '.year' content/_data/ese.yaml)
rsync -rvh --progress --delete --chmod=ugo=rwX _site/ ese-deploy@ifsr.de:"$year"