From a2788517bcb43b0c6d4a824f9c274f9fb66358e1 Mon Sep 17 00:00:00 2001 From: Mykola Buhaiov Date: Thu, 14 Mar 2024 15:55:49 +0200 Subject: [PATCH] ci: try fix docs --- .github/workflows/docc.yml | 49 +++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 14f6abf..a8fc560 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -4,6 +4,7 @@ on: # Runs on pushes targeting the default branch push: branches: ["main"] + workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -16,30 +17,40 @@ concurrency: group: "pages" cancel-in-progress: true +# Declare the jobs map, and start with the build job. jobs: - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + build: + # Because the script relies on xcrun and Xcode, youโ€™ll need a macOS runner. When using DocC as a Swift package plugin, you can use a Linux machine instead. runs-on: macos-13 + # One or more steps make up a job. Declare the list of steps, and start by checking out the repository taking only the last commit. Therefore, the fetch-depth option is set to 0. steps: - name: Checkout ๐Ÿ›Ž๏ธ uses: actions/checkout@v3 - - name: Build All DocC ๐Ÿ›  - run: | - swift package resolve; - xcodebuild docbuild -scheme fs-app-health-checks -derivedDataPath /tmp/docbuild -destination 'generic/platform=iOS'; - $(xcrun --find docc) process-archive \ - transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/AppHealthChecks.doccarchive \ - --output-path docs \ - --hosting-base-path apphealthchecks; - echo "" > docs/index.html; - - - name: Upload artifact ๐Ÿ“œ + with: + fetch-depth: 0 + # After checking out the repository, run the build-docc.sh script. + - name: Run Build Docs + run: ./build-docc.sh + # Use the actions that GitHub provides: one for configuring pages and another for uploading the contents that the script will generate and place under .docs. + # Notice how this is the same directory you set in the last line. + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - # Upload docs directory - path: 'docs' - - name: Deploy to GitHub Pages ๐Ÿ™ + path: .docs + # Define the deploy job. + deploy: + # Because Xcode isnโ€™t necessary anymore, you can choose a Linux runner. + runs-on: ubuntu-latest + # The previous job, build, created and uploaded the artifacts. So, add a dependency on that job, meaning that this one will only run when the first has finished. + needs: build + # Declare a single step for this job based on the official actions/deploy-pages Action. Set the environment variables it requires. + steps: + - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v2 + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }}