|
1 | 1 | name: docc |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
4 | 5 | branches: [ "main" ] |
| 6 | + |
5 | 7 | permissions: |
6 | 8 | contents: read |
7 | 9 | pages: write |
8 | 10 | id-token: write |
| 11 | + |
9 | 12 | concurrency: |
10 | 13 | group: pages |
11 | 14 | cancel-in-progress: true |
| 15 | + |
12 | 16 | jobs: |
13 | 17 | pages: |
14 | 18 | environment: |
15 | 19 | name: github-pages |
16 | 20 | url: '${{ steps.deployment.outputs.page_url }}' |
17 | 21 | runs-on: macos-latest |
| 22 | + |
18 | 23 | steps: |
19 | | - - uses: swift-actions/setup-swift@v1 |
20 | | - - name: git checkout |
| 24 | + - name: Checkout code |
21 | 25 | uses: actions/checkout@v3 |
22 | | - - name: docbuild |
23 | | - run: > |
24 | | - sudo xcode-select -s /Applications/Xcode_16.0.app; |
25 | | - xcodebuild docbuild -scheme Cache \ |
26 | | - -derivedDataPath /tmp/docbuild \ |
27 | | - -destination 'generic/platform=iOS'; |
28 | | - $(xcrun --find docc) process-archive \ |
29 | | - transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/Cache.doccarchive \ |
| 26 | + |
| 27 | + - name: Setup Xcode |
| 28 | + uses: maxim-lobanov/setup-xcode@v1 |
| 29 | + with: |
| 30 | + xcode-version: 16.0 |
| 31 | + |
| 32 | + - name: Set up Swift |
| 33 | + uses: swift-actions/setup-swift@v2 |
| 34 | + with: |
| 35 | + swift-version: '6.1.0' |
| 36 | + |
| 37 | + - name: Build and Export DocC |
| 38 | + run: | |
| 39 | + swift package --allow-writing-to-directory docs \ |
| 40 | + generate-documentation --target Cache \ |
30 | 41 | --output-path docs \ |
31 | | - --hosting-base-path 'Cache'; |
32 | | - echo "<script>window.location.href += |
33 | | - \"/documentation/cache\"</script>" > docs/index.html; |
34 | | - - name: artifacts |
35 | | - uses: actions/upload-pages-artifact@v1 |
| 42 | + --transform-for-static-hosting \ |
| 43 | + --hosting-base-path Cache |
| 44 | +
|
| 45 | + echo '<script>window.location.href += "/documentation/cache"</script>' > docs/index.html |
| 46 | +
|
| 47 | + - name: Configure Pages |
| 48 | + uses: actions/configure-pages@v5 |
| 49 | + |
| 50 | + - name: Upload Pages artifact |
| 51 | + uses: actions/upload-pages-artifact@v3 |
36 | 52 | with: |
37 | 53 | path: docs |
38 | | - - name: deploy |
| 54 | + |
| 55 | + - name: Deploy to GitHub Pages |
39 | 56 | id: deployment |
40 | | - uses: actions/deploy-pages@v1 |
| 57 | + uses: actions/deploy-pages@v4 |
0 commit comments