Skip to content

Commit

Permalink
Move workflow from deploy to master
Browse files Browse the repository at this point in the history
  • Loading branch information
xeonds committed Jul 19, 2023
1 parent 7ce28f2 commit 4576c7b
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/xdu-planet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit 4576c7b

Please sign in to comment.