Skip to content

Commit 170085c

Browse files
Copilotdannywillems
andcommitted
Add CI deployment step for documentation versioning on release tags
Co-authored-by: dannywillems <[email protected]>
1 parent 812fe7d commit 170085c

File tree

2 files changed

+54
-6
lines changed

2 files changed

+54
-6
lines changed

.github/workflows/docs.yaml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414

1515
concurrency:
1616
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17-
cancel-in-progress: true
17+
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' && !startsWith(github.ref, 'refs/tags/v') }}
1818

1919
jobs:
2020
# Test documentation build
@@ -122,17 +122,28 @@ jobs:
122122
id: deployment
123123
uses: actions/deploy-pages@v4
124124

125-
# Create versioned documentation on tag creation
125+
# Create and deploy versioned documentation on tag creation
126126
version-docs:
127127
if: startsWith(github.ref, 'refs/tags/v')
128-
needs: [build-docs]
129128
runs-on: ubuntu-latest
129+
environment:
130+
name: github-pages
131+
url: ${{ steps.deployment.outputs.page_url }}
132+
133+
permissions:
134+
contents: read
135+
pages: write
136+
id-token: write
137+
130138
steps:
131139
- name: Checkout repository
132140
uses: actions/checkout@v5
133141
with:
134142
fetch-depth: 0
135143

144+
- name: Setup Pages
145+
uses: actions/configure-pages@v5
146+
136147
- name: Setup Node.js
137148
uses: actions/setup-node@v5
138149
with:
@@ -161,10 +172,19 @@ jobs:
161172
sudo apt update
162173
sudo apt install -y protobuf-compiler
163174
175+
- name: Setup Rust
176+
uses: dtolnay/rust-toolchain@stable
177+
with:
178+
components: rustfmt
179+
# This should be in line with the verison in:
180+
# - Makefile
181+
# - ./github/workflows/docs.yaml
182+
# - ./github/workflows/fmt.yaml
183+
# - ./github/workflows/lint.yaml
184+
toolchain: nightly
185+
164186
- name: Build versioned documentation
165-
run: |
166-
cd website
167-
npm run build
187+
run: make docs-build
168188
env:
169189
NODE_ENV: production
170190

@@ -182,3 +202,12 @@ jobs:
182202
path: |
183203
mina-docs-${{ steps.version.outputs.version }}.tar.gz
184204
mina-docs-${{ steps.version.outputs.version }}.zip
205+
206+
- name: Upload to GitHub Pages
207+
uses: actions/upload-pages-artifact@v4
208+
with:
209+
path: website/build
210+
211+
- name: Deploy to GitHub Pages
212+
id: deployment
213+
uses: actions/deploy-pages@v4

website/docs/appendix/release-process.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,25 @@ This command:
320320
The versioned documentation will be available at `/docs/1.5.0/` and can be
321321
accessed through the version dropdown in the website navigation.
322322

323+
<!-- prettier-ignore-start -->
324+
325+
:::info Automated CI Deployment
326+
327+
When a release tag is created (e.g., `v1.5.0`), the GitHub Actions CI will
328+
automatically:
329+
330+
- Create a versioned copy of the documentation
331+
- Build the documentation with the new version included
332+
- Deploy the updated documentation to GitHub Pages
333+
- Upload versioned documentation archives as release assets
334+
335+
This means the documentation versioning and deployment is handled automatically
336+
as part of the tag creation process.
337+
338+
:::
339+
340+
<!-- prettier-ignore-stop -->
341+
323342
### 7. Create GitHub Release
324343

325344
```bash

0 commit comments

Comments
 (0)