-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (75 loc) · 2.14 KB
/
Copy pathbuild.yml
File metadata and controls
87 lines (75 loc) · 2.14 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build
on:
push:
paths-ignore:
- '.github/workflows/tag.yml'
workflow_dispatch:
inputs:
repo:
description: 'repo name'
required: false
schedule:
- cron: "0 0 * * *"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
run-name: Build ${{ github.event.inputs.repo }}
jobs:
deploy:
concurrency:
group: ${{ github.event.inputs.repo && 'incremental-build' || github.sha }}
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: Build Website
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Restore cache (incremental build)
if: ${{ github.event.inputs.repo }}
uses: actions/cache/restore@v4
with:
path: |
.cache
.data-cache
dist
key: modules-build-cache-${{ github.run_id }}
restore-keys: modules-build-cache-
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Install runzip
run: |
wget -q -O /usr/local/bin/runzip https://github.com/Ylarod/runzip/releases/download/v0.1.8/runzip-x86_64-unknown-linux-gnu
chmod +x /usr/local/bin/runzip
- name: Fetch module data
run: bun run scripts/fetch-data.ts
env:
GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }}
REPO: ${{ github.event.inputs.repo }}
- name: Build
run: bun run build
- name: Save cache
uses: actions/cache/save@v4
with:
path: |
.cache
.data-cache
dist
key: modules-build-cache-${{ github.run_id }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4