Repository navigation
98 lines (85 loc) · 2.8 KB
/
Copy pathgitpagedocs-pages.yml
File metadata and controls
98 lines (85 loc) · 2.8 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
88
89
90
91
92
93
94
95
96
97
98
name: Deploy GitPageDocs
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
env:
GITHUB_ACTIONS: "true"
GITHUB_REPOSITORY: ${{ github.repository }}
GITPAGEDOCS_REPOSITORY_SEARCH: "true"
steps:
- name: Checkout target repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Setup Pages
uses: actions/configure-pages@v5
with:
enablement: true
- name: Prepare runtime source
run: |
git clone --depth 1 https://github.com/Vidigal-code/git-page-docs.git .gitpagedocs-runtime
cp .gitpagedocs-runtime/gitpagedocs/icon.svg /tmp/default-icon.svg 2>/dev/null || true
if [ -d gitpagelayouts ]; then
rm -rf .gitpagedocs-runtime/gitpagelayouts
cp -R gitpagelayouts .gitpagedocs-runtime/gitpagelayouts
fi
if [ -d gitpagedocs ]; then
rm -rf .gitpagedocs-runtime/gitpagedocs
cp -R gitpagedocs .gitpagedocs-runtime/gitpagedocs
fi
mkdir -p .gitpagedocs-runtime/public
if [ -f icon.svg ]; then
cp icon.svg .gitpagedocs-runtime/public/icon.svg
elif [ -f gitpagedocs/icon.svg ]; then
cp gitpagedocs/icon.svg .gitpagedocs-runtime/public/icon.svg
elif [ -f /tmp/default-icon.svg ]; then
cp /tmp/default-icon.svg .gitpagedocs-runtime/public/icon.svg
fi
- name: Install runtime dependencies
run: pnpm install --frozen-lockfile
working-directory: .gitpagedocs-runtime
- name: Build search-home aggregator at the repository root
run: pnpm exec next build frontend && mv frontend/out out
working-directory: .gitpagedocs-runtime
- name: Add .nojekyll
run: touch .gitpagedocs-runtime/out/.nojekyll 2>/dev/null || mkdir -p .gitpagedocs-runtime/out && touch .gitpagedocs-runtime/out/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./.gitpagedocs-runtime/out
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
timeout: 900000
error_count: 30
reporting_interval: 10000