-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (112 loc) · 3.76 KB
/
deploy.yml
File metadata and controls
131 lines (112 loc) · 3.76 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Deploy website
on:
push:
branches: [main]
workflow_dispatch:
# Rebuild when atmosphere core changes (triggered from main repo)
repository_dispatch:
types: [rebuild-site]
# Nightly rebuild to pick up Javadoc changes from core repo
schedule:
- cron: '0 6 * * *'
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# ── Marketing site (Astro) ──
- uses: withastro/action@v3
with:
path: ./website
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# withastro/action uploads to the default pages artifact.
# Download it, merge in docs + javadoc, then re-upload.
- name: Download Astro artifact
uses: actions/download-artifact@v4
with:
name: github-pages
path: _site_archive
- name: Extract Astro build
run: |
mkdir -p _merged
tar -xf _site_archive/artifact.tar -C _merged
# ── Starlight docs ──
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: docs/package-lock.json
- name: Build Starlight docs
working-directory: docs
run: npm ci && npm run build
- name: Merge docs into site
run: cp -r docs/dist _merged/docs
# ── Javadoc (from main atmosphere repo) ──
- name: Checkout atmosphere core
uses: actions/checkout@v4
with:
repository: Atmosphere/atmosphere
ref: main
path: _atmosphere
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Extract project version
id: version
working-directory: _atmosphere
run: |
VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Compile sources
working-directory: _atmosphere
run: ./mvnw compile -pl modules/cpr -Pfastinstall -q
- name: Generate Javadoc
working-directory: _atmosphere
run: |
DEPS_CP=$(./mvnw dependency:build-classpath -pl modules/cpr -Dmdep.outputFile=/dev/stdout -q)
javadoc -d ../target/apidocs \
-sourcepath modules/cpr/src/main/java \
-classpath "$DEPS_CP" \
-subpackages org.atmosphere \
-source 21 \
-Xdoclint:none \
-quiet \
-encoding UTF-8 \
-windowtitle "Atmosphere ${{ steps.version.outputs.version }} API" \
-doctitle "Atmosphere Framework ${{ steps.version.outputs.version }} API" \
-header "Atmosphere ${{ steps.version.outputs.version }}" \
-bottom "Copyright © 2008-2026 Async-IO.org. All rights reserved." \
-link "https://docs.oracle.com/en/java/javase/21/docs/api/" \
-link "https://jakarta.ee/specifications/platform/9/apidocs/"
- name: Merge Javadoc into site
run: cp -r target/apidocs _merged/apidocs
# ── Upload merged artifact ──
- name: Delete Astro-only artifact
uses: geekyeggo/delete-artifact@v5
with:
name: github-pages
- name: Upload merged Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: _merged
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4