hourly-xdu-planet #1165
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
with: | |
node-version: 22 | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.23 | |
- 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: mkdir db/ && ./xdu-planet -fetch && mv db.json index.json db/ public/ | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
REPOSITORY_NAME: xdlinux/planet | |
BRANCH: web | |
FOLDER: public |