From 46b330e7669078276f080b1d0a25f9159f66a514 Mon Sep 17 00:00:00 2001 From: Fred Date: Tue, 8 Oct 2024 10:26:26 -0300 Subject: [PATCH] chore: add documentation job --- .github/workflows/pull_request_secure.yml | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/pull_request_secure.yml b/.github/workflows/pull_request_secure.yml index 5a45153f3c..0bc42cf8d8 100644 --- a/.github/workflows/pull_request_secure.yml +++ b/.github/workflows/pull_request_secure.yml @@ -257,6 +257,42 @@ jobs: env: PIP_FIND_LINKS: ${{ github.workspace }}/timefold-solver/dist run: tox + + build_documentation: + runs-on: ubuntu-latest + steps: + - name: Checkout frontend + id: checkout-frontend + uses: actions/checkout@v4 + with: + repository: TimefoldAI/frontend + token: ${{ secrets.JRELEASER_GITHUB_TOKEN }} # Safe; only used to clone the repo and not stored in the fork. + fetch-depth: 0 # Otherwise merge will fail on account of not having history. + + - name: Set up NodeJs + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + + - name: Build Documentation + env: + GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }} + run: | + sed -i 's/tags:\s*\[v[0-9.]*,\s*v0.8.42]/tags: \[main]/' apps/docs/antora-playbook.yml + npm ci + npm run build -- --filter docs + + - name: Deploy Documentation (Preview Mode) + if: ${{ github.ref != 'refs/heads/main' }} + id: deploy + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + workingDirectory: ./apps/docs + command: pages deploy ./public-serve --project-name=timefold-docs --branch=${{ github.ref }} + sonarcloud: needs: approval_required name: SonarCloud