Merge pull request #137 from backstage/renovate/backstage-monorepo #129
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: CD | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| # Cancel in-progress deployments for same branch | |
| concurrency: | |
| group: pages-${{ github.ref }} | |
| cancel-in-progress: true | |
| # Required permissions for GitHub Pages deployment | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| checks: read # Required for wait-on-check-action to query CI status | |
| jobs: | |
| # Wait for CI to complete before deploying | |
| check-ci: | |
| name: Wait for CI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Wait for CI workflow | |
| uses: lewagon/wait-on-check-action@v1.9.1 | |
| with: | |
| ref: ${{ github.ref }} | |
| check-name: 'Type Check, Lint, Test & Build' | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| wait-interval: 10 | |
| build: | |
| name: Build | |
| needs: check-ci | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| env: | |
| CI: true | |
| NODE_OPTIONS: --max-old-space-size=4096 | |
| NEXT_PUBLIC_GA_ID: ${{ secrets.NEXT_PUBLIC_GA_ID }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '24' | |
| cache: 'yarn' | |
| - name: Cache Next.js build | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| .next/cache | |
| key: ${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nextjs- | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Build | |
| run: yarn build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: ./out | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |