From 5602a3692ceb211c5762c631e132ef690f00606b Mon Sep 17 00:00:00 2001 From: david-swift Date: Sun, 31 Mar 2024 19:59:00 +0200 Subject: [PATCH] Add workflow for DocC docs --- .github/workflows/docs.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..53ee3ce --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,46 @@ +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-14 + steps: + - uses: actions/checkout@v4 + - name: Install Libadwaita + run: | + brew update + brew install libadwaita + sed -i '' 's/-I..includedir.//g' $(brew --prefix)/Library/Homebrew/os/mac/pkgconfig/*/libffi.pc + - name: Build Docs + run: | + xcrun xcodebuild docbuild \ + -scheme Adwaita \ + -destination 'generic/platform=macOS' \ + -derivedDataPath "$PWD/.derivedData" + xcrun docc process-archive transform-for-static-hosting \ + "$PWD/.derivedData/Build/Products/Debug/Adwaita.doccarchive" \ + --output-path "docs" \ + --hosting-base-path "adwaita-swift" + echo "" > docs/index.html; + - name: Upload Artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'docs' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4