-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (53 loc) · 1.56 KB
/
deploy-github.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Deploy Site
on:
push:
branches:
- main
jobs:
deploy-gh-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Build Site
env:
NODE_OPTIONS: --max_old_space_size=4096
run: pnpm build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist
deploy-server:
runs-on: ubuntu-latest
needs: deploy-gh-pages
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0
- name: Configuration environment
run: |
mkdir -p ~/.ssh/
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan hope-studio.innenu.com >> ~/.ssh/known_hosts
git config --global user.name 'Mr.Hope'
git config --global user.email '[email protected]'
- name: Deploy
run: |
ssh [email protected] "git config --global --add safe.directory /www/wwwroot/hope-studio"
git push -f [email protected]:/www/wwwroot/hope-studio gh-pages
ssh [email protected] "cd /www/wwwroot/hope-studio && git reset --hard HEAD"