-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (71 loc) · 2.01 KB
/
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
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
name: Deploy to GitHub Pages
on:
push:
branches:
- master
workflow_dispatch:
permissions:
pages: write
contents: read
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
cache: yarn
node-version: 16
- name: Restore cache
uses: actions/cache@v3
with:
path: |
.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Copy .env file
run: cp .env.example .env.local
- name: Build with Next.js
run: yarn next build
- name: Static HTML export with Next.js
run: yarn next export
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./out
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
index:
runs-on: ubuntu-latest
needs: [ deploy ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Give GitHub a little time to deploy
run: sleep 30s
- name: Get DocSearch config
id: algolia_config
run: echo "config=$(cat docsearch_config.json | jq -r tostring)" >> $GITHUB_OUTPUT
- name: Index to Algolia
uses: signcl/docsearch-scraper-action@v1.0.1
env:
APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }}
API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
CONFIG: ${{ steps.algolia_config.outputs.config }}