ese-website/.forgejo/workflows/publish.yaml
Lyn Fugmann 9290cd8771
All checks were successful
publish / publish (push) Successful in 31s
auto deploy
2024-10-06 23:06:29 +02:00

43 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 }}
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"