-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (62 loc) · 2.05 KB
/
Copy pathmanual-generate.yml
File metadata and controls
65 lines (62 loc) · 2.05 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
name: Manual Generate Cache (No Pull)
on:
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v4
- name: Clone trease-backend repository
run: |
git clone --recurse-submodules https://github.com/Trease-Focus/trease-tree-compiler.git trease-backend --depth 1
- name: Install ffmpeg
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
working-directory: trease-backend
run: bun install
- name: Generate Image Cache
working-directory: trease-backend
run: bun run cache-gen/generate_image_cache.ts
- name: Generate Video Cache
working-directory: trease-backend
run: bun run cache-gen/generate_video_cache.ts
- name: Generate Data Cache
working-directory: trease-backend
run: bun run cache-gen/generate_entity_data.ts
- name: Prepare output for GitHub Pages
run: |
mkdir -p _site
cp -r trease-backend/cache/* _site/ 2>/dev/null
if [ ! -f _site/index.html ]; then
echo '<!DOCTYPE html><html><head><title>Image Cache</title></head><body><h1>Image Cache Generated</h1><p>Last updated: '"$(date -u)"'</p></body></html>' > _site/index.html
fi
- name: Copy Additional Assets
run: |
cp cache/images/* _site/images 2>/dev/null || true
cp cache/video/* _site/video 2>/dev/null || true
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '_site'
deploy:
environment:
name: github-pages
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4