Replaced hardcoded values with secrets #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy new documentation to GitHub Pages | |
| on: | |
| push: | |
| branches: ["**"] | |
| paths: | |
| - "apps/docs-new/**" | |
| - "apps/web/openapi/**" | |
| - ".github/workflows/deploy-docs-new-to-pages.yml" | |
| - "pnpm-lock.yaml" | |
| - "pnpm-workspace.yaml" | |
| - "package.json" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages-docs-new" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@v5 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate OpenAPI spec | |
| run: pnpm --filter @courselit/web openapi:generate | |
| - name: Build docs site | |
| env: | |
| NEXT_PUBLIC_BASE_PATH: ${{ steps.pages.outputs.base_path }} | |
| NEXT_PUBLIC_ORAMA_PROJECT_ID: ${{ secrets.ORAMA_PROJECT_ID }} | |
| NEXT_PUBLIC_ORAMA_API_KEY: ${{ secrets.ORAMA_API_KEY }} | |
| run: pnpm --filter @courselit/docs-new build | |
| - name: Sync Orama search index | |
| env: | |
| NEXT_PUBLIC_ORAMA_DATASOURCE_ID: ${{ secrets.ORAMA_DATASOURCE_ID }} | |
| NEXT_PUBLIC_ORAMA_PROJECT_ID: ${{ secrets.ORAMA_PROJECT_ID }} | |
| ORAMA_PRIVATE_API_KEY: ${{ secrets.ORAMA_PRIVATE_API_KEY }} | |
| run: pnpm --filter @courselit/docs-new search:sync | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./apps/docs-new/out | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |