Skip to content

Commit e422969

Browse files
piti6claude
andcommitted
ci: add GitHub Actions workflow to deploy web pages to GitHub Pages
Builds Re:VIEW web output and search index on push to main, then deploys to GitHub Pages via actions/deploy-pages. Requires Pages source set to 'GitHub Actions' in repo settings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cfd4b71 commit e422969

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/deploy-web.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Deploy Web to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Ruby
25+
uses: ruby/setup-ruby@v1
26+
with:
27+
ruby-version: '3.3'
28+
bundler-cache: true
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
cache: 'npm'
35+
36+
- name: Install npm dependencies
37+
run: npm install --ignore-scripts
38+
39+
- name: Install gem dependencies
40+
run: bundle install
41+
42+
- name: Build web pages
43+
run: REVIEW_CONFIG_FILE=config-epub-jp.yml npx grunt web
44+
45+
- name: Build search index
46+
run: node build-search-index.js
47+
48+
- name: Setup Pages
49+
uses: actions/configure-pages@v4
50+
51+
- name: Upload artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: articles/webroot
55+
56+
deploy:
57+
needs: build
58+
runs-on: ubuntu-latest
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)