eolas-app/.forgejo/workflows/deploy.yaml

38 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2025-10-07 19:16:16 +01:00
name: Deploy eolas-app
on:
2025-11-07 16:01:41 +00:00
push:
branches: [main]
2025-10-07 19:16:16 +01:00
jobs:
2025-11-07 16:01:41 +00:00
deploy:
runs-on: ubuntu-latest
container: node:20
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npm run build
env:
VITE_EOLAS_API_ENDPOINT: ${{ vars.EOLAS_API_ENDPOINT }}
VITE_EOLAS_API_KEY: ${{ secrets.EOLAS_API_KEY }}
2025-11-07 16:01:41 +00:00
- 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 'cd /var/www/eolas-app && rm -rf * .[^.]*'"
scp -i /tmp/ssh_key -o StrictHostKeyChecking=no -r dist/* ${{ vars.VPS_DEPLOY_USER }}:/var/www/eolas-app/
rm /tmp/ssh_key
- name: Notify success
if: success()
run: |
curl -u thomas:${{ secrets.NTFY_PASSWORD }} \
-H "Tags: Forgejo Runner" \
-d "🟩 eolas-app successfully deployed" \
https://ntfy.systemsobscure.net/eolas
- name: Notify failure
if: failure()
run: |
curl -u thomas:${{ secrets.NTFY_PASSWORD }} \
-H "Tags: Forgejo Runner" \
-d "🟥 An error occurred deploying eolas-app. See Forgejo Action logs." \
https://ntfy.systemsobscure.net/eolas