-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (33 loc) · 1.13 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
on:
push:
branches:
- main
- release/*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Git for sparse checkout
run: |
git init
git remote add origin https://github.com/TechTOnions/TechTOnions_Discord_Bot
git config core.sparseCheckout true
echo "Frontend/" > .git/info/sparse-checkout
git pull origin 'main'
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Build the project
run: npm run build
- name: Deploy to Server
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} # Secret for SSH private key
SSH_HOST: ${{ secrets.SSH_HOST }} # Secret for SSH host
SSH_USERNAME: ${{ secrets.SSH_USERNAME }} # Secret for SSH username
run: |
echo "$SSH_PRIVATE_KEY" > private_key
chmod 600 private_key
rsync -avz --delete -e "ssh -i private_key -o StrictHostKeyChecking=no" /www/wwwroot/TechTOnions_Bot/Frontend/ $SSH_USERNAME@$SSH_HOST:/path/to/deploy