-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (72 loc) · 1.99 KB
/
build_deploy.yml
File metadata and controls
84 lines (72 loc) · 1.99 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
name: build_deploy
on:
push:
branches: [ main ]
pull_request:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: Build site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- name: Use Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.3
- name: Cache aggregate state
uses: actions/cache@v4
with:
path: .cache/aggregate
key: mn-aggregate-${{ github.run_id }}
restore-keys: mn-aggregate-
- name: Build site (fetch releases + Jekyll)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec rake build
- name: Verify build
run: |
doc_count=$(python3 -c "import json; print(len(json.load(open('_data/documents.json')).get('items',[])))")
if [ "$doc_count" -eq 0 ]; then
echo "::error::Build produced 0 documents — aborting deploy"
exit 1
fi
echo "Verified: $doc_count documents"
- name: Debug
if: ${{ github.ref != 'refs/heads/main' }}
run: |
ls -al _site
ls _site/docs | head -20
ls _site/relaton 2>/dev/null || echo "(no relaton dir)"
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4