-
-
Notifications
You must be signed in to change notification settings - Fork 155
36 lines (32 loc) · 970 Bytes
/
deploy.yml
File metadata and controls
36 lines (32 loc) · 970 Bytes
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
name: Deploy to GitHub Pages
on:
push:
branches:
- main
- documentation
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to VPS via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: ${{ secrets.SERVER_PORT }}
script: |
export PATH=$PATH:/root/.bun/bin
source ~/.bashrc 2>/dev/null || true
cd /opt/website/
git pull origin ${{ github.ref_name }}
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
COMMIT_HASH=$(git rev-parse --short HEAD)
echo "{\"branch\":\"$BRANCH_NAME\",\"commit\":\"$COMMIT_HASH\"}" > public/git-info.json
bun run build
pm2 restart website