Repository navigation
89 lines (74 loc) · 2.18 KB
/
Copy pathpages.yml
File metadata and controls
89 lines (74 loc) · 2.18 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
# Build the site from the Mobium repository, check every example against the
# surface it is written for, and publish it to GitHub Pages.
name: Pages
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
# The reference follows mobiumdev/mobium's main; rebuild daily so a change
# there reaches the site without a commit here.
schedule:
- cron: "17 6 * * *"
permissions:
contents: read
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Which Mobium
id: ref
run: echo "ref=$(cat mobium.ref)" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v7
with:
repository: mobiumdev/mobium
ref: ${{ steps.ref.outputs.ref }}
path: mobium
- uses: actions/setup-go@v7
with:
go-version-file: mobium/go.mod
cache-dependency-path: mobium/go.sum
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: 21
- uses: actions/setup-dotnet@v6
with:
dotnet-version: 8.0.x
- name: Build mobium
run: go build -C mobium -o "$RUNNER_TEMP/mobium" ./cmd/mobium
- run: npm ci
- name: Read the surfaces
run: python3 scripts/extract.py --src mobium --bin "$RUNNER_TEMP/mobium"
- name: Check every example
env:
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
DOTNET_NOLOGO: "1"
run: python3 scripts/check_examples.py --src mobium
- name: Write the pages
run: python3 scripts/generate.py --src mobium
- run: npm run build
- uses: actions/upload-pages-artifact@v5
with:
path: build
deploy:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5