ese-website/.forgejo/workflows/publish.yaml
Lyn Fugmann 577ee27186
All checks were successful
publish / publish (push) Successful in 32s
set timezone in CI
2024-10-07 19:28:01 +02:00

44 lines
1.1 KiB
YAML

name: publish
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_DEPLOY_PRIVATE_KEY }}
TZ: Europe/Berlin
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm ci
- run: npm run build
- name: upload artifact
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
path: _site
- 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"