-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (48 loc) · 1.68 KB
/
Copy pathdocc.yml
File metadata and controls
56 lines (48 loc) · 1.68 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
# Generates and Deploys DocC documentation to Github pages
# See: https://maxxfrazer.medium.com/deploying-docc-with-github-actions-218c5ca6cad5
name: DocC
on:
push:
branches: [ "main" ]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Single deploy job since we're just deploying
docc:
environment:
# Must be set to this for deploying to GitHub Pages
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
runs-on: macos-26
steps:
- uses: actions/checkout@v4
- name: Add Plugin Dependency
run: swift package add-dependency "https://github.com/apple/swift-docc-plugin" --branch main
- name: Generate Documentation
run: |
swift package \
--allow-writing-to-package-directory \
--allow-writing-to-directory ${{github.workspace}}/docs \
generate-documentation \
--target OAuthKit \
--transform-for-static-hosting \
--hosting-base-path OAuthKit \
--output-path ${{github.workspace}}/docs \
--source-service github \
--source-service-base-url https://github.com/codefiesta/OAuthKit/blob/main \
--checkout-path ${{github.workspace}};
- name: Update Index
run: echo "<script>window.location.href += \"/documentation/oauthkit\"</script>" > ${{github.workspace}}/docs/index.html;
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs'
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4