All checks were successful
Deploy eolas-app / deploy (push) Successful in 53s
37 lines
1.3 KiB
YAML
37 lines
1.3 KiB
YAML
name: Deploy eolas-app
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
jobs:
|
|
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 }}
|
|
- 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
|