-
Notifications
You must be signed in to change notification settings - Fork 11
55 lines (48 loc) · 1.18 KB
/
xdu-planet.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
name: hourly-xdu-planet
on:
schedule:
- cron: '10 4,10,22 * * *'
push:
branches:
- master
- deploy
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: master
path: ./
- name: Checkout deploy
uses: actions/checkout@v2
with:
ref: deploy
path: ./deploy
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 17
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Make dir
run: mkdir public
- name: Copy config
run: cp deploy/config.yml ./ && ls
- name: Build frontend
run: cd frontend && npm install pnpm -g && pnpm install && pnpm run build && cd ..
- name: Copy dist
run: cp -r frontend/dist/* public/
- name: Build main program
run: go mod tidy && go build
- name: Run generate
run: ./xdu-planet -fetch && mv db.json public/
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
REPOSITORY_NAME: xeonds/xdu-planet
BRANCH: web
FOLDER: public