Skip to content

Commit fb4bb9b

Browse files
authored
Add GitHub Actions workflow for documentation publishing
This workflow generates and publishes DocC documentation to GitHub Pages upon pushes to the main branch or when a version tag is created.
1 parent 247b8cf commit fb4bb9b

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# .github/workflows/documentation.yml
2+
# Generates and publishes DocC documentation to GitHub Pages
3+
4+
name: Documentation
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
tags:
11+
- 'v*'
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
concurrency:
20+
group: pages
21+
cancel-in-progress: true
22+
23+
jobs:
24+
build:
25+
runs-on: macos-14
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Xcode
31+
uses: maxim-lobanov/setup-xcode@v1
32+
with:
33+
xcode-version: latest-stable
34+
35+
- name: Build Documentation
36+
run: |
37+
swift package generate-documentation \
38+
--target DataStructuresKit \
39+
--disable-indexing \
40+
--transform-for-static-hosting \
41+
--hosting-base-path DataStructuresKit \
42+
--output-path docs
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: docs
48+
49+
deploy:
50+
needs: build
51+
runs-on: ubuntu-latest
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)