-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (31 loc) · 855 Bytes
/
deploy.yml
File metadata and controls
35 lines (31 loc) · 855 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
name: Compile and Deploy to GitHub Page
on:
push:
branches:
- source
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: refs/heads/source
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies and deploy
run: |
npm i -g hexo-cli
npm i --ignore-scripts
mkdir -p ~/.ssh/
echo "$GH_ACTION_DEPLOY_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.email "chen@qq.com"
git config --global user.name "chen"
npm run build
npm run deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_ACTION_DEPLOY_KEY: ${{secrets.GH_ACTION_DEPLOY_KEY}}