-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (38 loc) · 1.02 KB
/
deploy.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
36
37
38
39
name: Deploy burrito server to VPS
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --all-features
deploy:
runs-on: ubuntu-latest
needs: test
steps:
- name: Pull and deploy to VPS
uses: appleboy/[email protected]
with:
host: ${{ vars.SSH_HOST }}
username: ${{ vars.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
debug: true
envs: REPO_PATH,APP_ENV_FILE
command_timeout: 30m
script: |
cd $REPO_PATH
git reset --hard
git clean -df
git pull origin $GITHUB_REF
echo "$APP_ENV_FILE" > .env
docker compose -f docker-compose.prod.yml up -d --build
env:
REPO_PATH: ${{ vars.SSH_REPO_PATH }}
APP_ENV_FILE: |
${{ secrets.ENV_FILE }}