systems-obscure/.forgejo/workflows/deploy.yaml
thomasabishop 2ff93eda01
All checks were successful
Deploy Blog / deploy (push) Successful in 2m2s
fix: remove redundant run clause
2025-11-25 17:56:17 +00:00

39 lines
1.5 KiB
YAML

name: Deploy Blog
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
container: node:18
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npm run build:posts
- run: npm run build
env:
VITE_EOLAS_API_URL: ${{ vars.EOLAS_API_ENDPOINT }}
VITE_EOLAS_API_KEY: ${{ secrets.EOLAS_API_KEY }}
VITE_WAKAPI_URL: ${{ vars.WAKAPI_URL }}
VITE_WAKAPI_TOKEN: ${{ secrets.WAKAPI_TOKEN }}
- run: |
echo "${{ secrets.VPS_DEPLOY_USER_SSH_KEY }}" > /tmp/ssh_key
chmod 600 /tmp/ssh_key
ssh -i /tmp/ssh_key -o StrictHostKeyChecking=no ${{ vars.VPS_DEPLOY_USER }} "bash -c 'rm -rf /var/www/systemsobscure.blog/*'"
scp -i /tmp/ssh_key -o StrictHostKeyChecking=no -r dist/* ${{ vars.VPS_DEPLOY_USER }}:/var/www/systemsobscure.blog/
rm /tmp/ssh_key
- name: Notify success
if: success()
run: |
curl -u thomas:${{ secrets.NTFY_PASSWORD }} \
-H "Tags: Forgejo Runner" \
-d "🟩 systemsobscure.blog successfully deployed" \
https://ntfy.systemsobscure.net/sysobs
- name: Notify failure
if: failure()
run: |
curl -u thomas:${{ secrets.NTFY_PASSWORD }} \
-H "Tags: Forgejo Runner" \
-d "🟥 systemsobscure.blog deployment failed. See Forgejo Action logs." \
https://ntfy.systemsobscure.net/sysobs