-
Notifications
You must be signed in to change notification settings - Fork 7
35 lines (32 loc) · 997 Bytes
/
deploy-api.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Deploy API Service
on:
push:
paths:
- 'api/**'
pull_request:
paths:
- 'api/**'
env:
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
DUCKDB_POOL_SIZE: 5
jobs:
deploy:
runs-on: ubuntu-latest
if: >
github.ref == 'refs/heads/main' &&
secrets.DEPLOY_SSH_KEY &&
secrets.DEPLOY_HOST_DNS &&
secrets.DEPLOY_USERNAME &&
secrets.DEPLOY_TARGET_DIR
steps:
- uses: actions/checkout@v3
- run: rm -rf .git
- uses: easingthemes/ssh-deploy@main
env:
ARGS: -rlgoDzvc -i --delete
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
REMOTE_HOST: ${{ secrets.DEPLOY_HOST_DNS }}
REMOTE_USER: ${{ secrets.DEPLOY_USERNAME }}
SCRIPT_BEFORE: sudo supervisorctl stop substrait-fiddle:*
SCRIPT_AFTER: sudo chown -R www-data:www-data ${{ secrets.DEPLOY_TARGET_DIR }} && sudo supervisorctl start substrait-fiddle:*
TARGET: ${{ secrets.DEPLOY_TARGET_DIR }}