diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/deploy-gh-pages.yaml index 6f036e6d..43388515 100644 --- a/.github/workflows/deploy-gh-pages.yaml +++ b/.github/workflows/deploy-gh-pages.yaml @@ -30,20 +30,26 @@ jobs: uses: actions/checkout@v4 - name: Set up mdBook 📚 + if: matrix.service == 'account' # Only upload mdbook once uses: ./.github/workflows/common/set-up-mdbook with: token: ${{secrets.GITHUB_TOKEN}} - name: Setup Pages + if: matrix.service == 'account' # Only setup Pages once id: pages uses: actions/configure-pages@v4 - name: Build with mdBook + if: matrix.service == 'account' # Only build mdbook once working-directory: docs run: mdbook build && ls book - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + # Upload the mdBook output to GitHub Pages + - name: Upload mdbook to GitHub Pages + if: matrix.service == 'account' # Only upload mdbook once + uses: actions/upload-artifact@v3 with: + name: mdbook path: ./docs/book # Publish OpenAPI specs for each microservice @@ -52,19 +58,53 @@ jobs: with: service: ${{ matrix.service }} - - name: Publish OpenAPI UI to GitHub Pages + - name: Upload OpenAPI UI to GitHub Pages uses: actions/upload-pages-artifact@v3 with: + name: openapi-${{ matrix.service }} path: ./docs/${{ matrix.service }} # Deployment job deploy: + runs-on: ubuntu-latest + needs: build environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download mdbook artifact + uses: actions/download-artifact@v3 + with: + name: mdbook + path: ./docs/book + + - name: Download account OpenAPI artifacts + uses: actions/download-artifact@v3 + with: + name: openapi-account + path: ./docs/account + + - name: Download content-watcher OpenAPI artifacts + uses: actions/download-artifact@v3 + with: + name: openapi-content-watcher + path: ./docs/content-watcher + + - name: Download content-publishing OpenAPI artifacts + uses: actions/download-artifact@v3 + with: + name: openapi-content-publishing + path: ./docs/content-publishing + + - name: Download graph OpenAPI artifacts + uses: actions/download-artifact@v3 + with: + name: openapi-graph + path: ./docs/graph + - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4