From 02ea92c39b50abeae44d24e97a86ee2f18d767a6 Mon Sep 17 00:00:00 2001 From: Nacho Vazquez Date: Sun, 14 Jul 2024 00:14:33 -0300 Subject: [PATCH] ci: move the publishing of the docs to the release pipeline to sync the package with the docs (#212) ## PR Checklist Please check if your PR fulfills the following requirements: - [x] The commit message follows our guidelines: CONTRIBUTING.md#commit - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] Docs have been added / updated (for bug fixes / features) ## PR Type What kind of change does this PR introduce? ``` [ ] Bugfix [ ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Build related changes [x] CI related changes [ ] Documentation content changes [ ] Other... Please describe: ``` ## What is the current behavior? Every time we merge a PR the docs are automatically deployed. ## What is the new behavior? Docs are deployed only when a manual release is triggered ## Does this PR introduce a breaking change? ``` [ ] Yes [x] No ``` --- .github/workflows/ci.yml | 33 --------------------------------- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7be87c94..e1d4b21f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,39 +99,6 @@ jobs: pnpm exec nx affected -t lint test build pnpm exec nx affected -t e2e-ci --parallel=1 - deploy-docs: - name: '[Merge] Deploy docs to GitHub Pages' - needs: main - if: github.event_name == 'push' && github.ref_name == 'main' - runs-on: ubuntu-latest - permissions: - contents: read - actions: read - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Check out the source code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup - uses: ./.github/actions/setup - # Uses the cache generated in the distributed step - - name: Build docs - run: pnpm exec nx build docs-lumberjack-docs-app - - name: Set up GitHub Pages - uses: actions/nonfigure-pages@v4 - - name: Upload docs to GitHub Pages - uses: actions/upload-pages-artifact@v3 - with: - path: dist/packages/docs/lumberjack-docs-app/ - - name: Deploy docs to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 - sonarcloud: name: SonarCloud needs: main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 083f6683..ad4216cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,3 +60,36 @@ jobs: branch: ${{ github.ref }} force: true tags: true + + deploy-docs: + name: '[Merge] Deploy docs to GitHub Pages' + needs: main + if: github.event_name == 'push' && github.ref_name == 'main' + runs-on: ubuntu-latest + permissions: + contents: read + actions: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Check out the source code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup + uses: ./.github/actions/setup + # Uses the cache generated in the distributed step + - name: Build docs + run: pnpm exec nx build docs-lumberjack-docs-app + - name: Set up GitHub Pages + uses: actions/configure-pages@v4 + - name: Upload docs to GitHub Pages + uses: actions/upload-pages-artifact@v3 + with: + path: dist/packages/docs/lumberjack-docs-app/ + - name: Deploy docs to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4