41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
name: Deploy Docs
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
Deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: macos-15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Build Docs
|
|
run: |
|
|
sed -i '' -n 'H;${x;s/^\n//;s/ .package.*$/ .package(url: "https:\/\/github.com\/swiftlang\/swift-docc-plugin", from: "1.3.0"),\n&/;p;}' Package.swift
|
|
swift package --allow-writing-to-directory ./docs \
|
|
generate-documentation --target TermKitBackend --output-path ./docs \
|
|
--transform-for-static-hosting --hosting-base-path TermKitBackend
|
|
- name: Modify Docs
|
|
run: |
|
|
echo "<script>window.location.href += \"/documentation/termkitbackend\"</script>" > docs/index.html;
|
|
sed -i '' 's/,2px/,10px/g' docs/css/index.*.css
|
|
- name: Upload Artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: 'docs'
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|