-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.43 KB
/
deploy-github-pages.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
name: deploy-github-pages
on:
push:
schedule:
# run at 3am in the morning (UTC) on weekdays
- cron: 0 3 * * 1-5
jobs:
deploy-github-pages:
runs-on: ubuntu-latest
environment: github-pages
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup build environment
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Enable corepack and upgrade Yarn
run: |
corepack enable
yarn set version ./.yarn/releases/yarn-4.2.2.cjs
- name: Install dependencies
run: yarn install --immutable
- name: Check code style
run: yarn gate
- name: Build app
run: yarn build
env:
DYNATRACE_API_TOKEN: ${{ secrets.DYNATRACE_API_TOKEN }}
- name: Get cached index.json
if: ${{ github.event_name != 'schedule' }}
run: curl --fail https://jkuroomsearch.app/data/index.json -o index.json
- name: Scrape new index.json
if: ${{ github.event_name == 'schedule' }}
run: node ./dist/js/scraper.js
- name: Move index.json
run: |
mkdir ./dist/data
mv index.json ./dist/data
- name: Deploy to GitHub Pages
if: success()
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
force_orphan: true