Files
strudel/.forgejo/workflows/test.yml
T
2025-12-02 09:28:23 +00:00

47 lines
1.5 KiB
YAML

name: Strudel test + warm deploy
on: [push, pull_request]
jobs:
test-and-warm-deploy:
runs-on: docker
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Debug Forgejo context
run: |
echo "EVENT_NAME = ${{ forgejo.event_name }}"
echo "REF = ${{ forgejo.ref }}"
echo "REF_NAME = ${{ forgejo.ref_name }}"
- name: apt install ztd
run: apt update && apt install -y zstd
- uses: pnpm/action-setup@v4
with:
version: 9.12.2
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- run: pnpm install
- run: pnpm run format-check
- run: pnpm run lint
- run: pnpm test
- name: Build
if: ${{ forgejo.event_name == 'push' && forgejo.ref == 'refs/heads/main' }}
run: pnpm build
- name: Warm deploy
# automatically deploy to warm on pushes to main
if: ${{ forgejo.event_name == 'push' && forgejo.ref == 'refs/heads/main' }}
run: |
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | ssh-add -
apt update && apt install -y rsync
mkdir ~/.ssh
ssh-keyscan matrix.toplap.org > ~/.ssh/known_hosts
rsync -atv --delete --delete-after --progress ./website/dist/ strudel@matrix.toplap.org:/home/strudel/deploy/warm.strudel.cc