-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.29 KB
/
Copy pathdeploy-discovery.yml
File metadata and controls
58 lines (48 loc) · 1.29 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
# Deploy Search app to GitHub Pages
name: Deploy Search to GitHub Pages
env:
CI: false
on:
repository_dispatch:
push:
branches: ["main"]
pull_request:
types: closed
branches: ["main"]
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "npm"
- name: Install dependencies
run: npm install --legacy-peer-deps
- name: Build for GitHub Pages deployment
run: npm run build:with-cache
env:
GITHUB_PAGES_DEPLOYMENT: "true"
NEXT_STATIC_EXPORT: "true"
- name: Create .nojekyll file
run: touch out/.nojekyll
- name: Copy index.txt to <route>.txt for each route
run: |
for dir in out/*/; do
name=$(basename "$dir")
if [ -f "out/$name/index.txt" ]; then
cp "out/$name/index.txt" "out/$name.txt"
fi
done
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: out
branch: gh-pages
clean: true