Skip to content

ci: update pages publish #17

ci: update pages publish

ci: update pages publish #17

Workflow file for this run

name: Publish DocC
on:
workflow_dispatch:
push:
branches:
- main
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Swift
uses: swift-actions/setup-swift@v2
with:
swift-version: '6.2'
- name: Build DocC
run: |
set -euo pipefail
output_root="${GITHUB_WORKSPACE}/_site"
rm -rf "${output_root}"
mkdir -p "${output_root}"
docc convert "wrkstrm.docc" \
--output-path "${output_root}" \
--transform-for-static-hosting \
--hosting-base-path /
# Root landing should go to the documentation index.
echo '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=/documentation/index/"></head></html>' > "${output_root}/index.html"
touch "${output_root}/.nojekyll"
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site
deploy:
strategy:
matrix:
os: [ubuntu-latest]
needs: build
runs-on: ${{ matrix.os }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}documentation/index/
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
- name: Print Deployed URL
run: echo "Deployed to ${{ steps.deployment.outputs.page_url }}documentation/index/"