lua.re/.gitea/workflows/push.yaml

30 lines
658 B
YAML
Raw Normal View History

2024-12-03 18:08:24 +11:00
name: Deploy website
on:
push:
branches:
- master
jobs:
deploy:
runs-on: luare
2024-12-03 18:15:20 +11:00
env:
DEPLOY_HOST: lilac.a.lua.re
2024-12-03 18:27:52 +11:00
SSH_OPTS: -o ForwardAgent=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
2024-12-03 18:15:20 +11:00
2024-12-03 18:08:24 +11:00
steps:
2024-12-03 18:15:20 +11:00
- name: Checkout
uses: actions/checkout@v4
- name: Build project
2024-12-03 18:23:07 +11:00
run: |
pnpm install
pnpm build
2024-12-03 18:15:20 +11:00
- name: Deploy to server
2024-12-03 18:08:24 +11:00
run: |
eval "$(ssh-agent -s)"
trap 'eval $(ssh-agent -k)' EXIT
ssh-add - <<< "${{ secrets.SSH_KEY }}"
2024-12-03 18:27:52 +11:00
rsync -avzhe "ssh $SSH_OPTS" --delete 'dist/' "caddy@$DEPLOY_HOST:sites/lua.re/"