Skip to content

Fix L1 cache key to include all API-affecting parameters #42

Fix L1 cache key to include all API-affecting parameters

Fix L1 cache key to include all API-affecting parameters #42

Workflow file for this run

name: Deploy to Hetzner
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build
run: bun run build
- name: Prepare standalone output
run: |
cp -r .next/static .next/standalone/.next/static
cp -r public .next/standalone/public
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -p 1993 -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
- name: Deploy standalone to server
run: |
rsync -avz --delete \
-e "ssh -i ~/.ssh/deploy_key -p 1993" \
.next/standalone/ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/
- name: Restart PM2
run: |
ssh -i ~/.ssh/deploy_key -p 1993 ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} "\
cd ${{ secrets.DEPLOY_PATH }} && \
pm2 delete prayCalendar 2>/dev/null || true && \
ANALYTICS_KEY='${{ secrets.ANALYTICS_KEY }}' \
PORT=3001 pm2 start server.js --name prayCalendar --update-env"