Portal deploy #994
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: Portal deploy | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: { group: portal-deploy, cancel-in-progress: true } | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: { python-version: '3.12' } | |
| - run: pip install -r requirements.txt | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Render landing content | |
| run: python generate.py --landing site/src/content/docs/index.md | |
| env: | |
| # DASHBOARD_PAT: fine-grained PAT that can read private pack repos. | |
| GITHUB_TOKEN: ${{ secrets.DASHBOARD_PAT || secrets.GITHUB_TOKEN }} | |
| - name: Generate Worker routes + search indexes | |
| run: python generate_routes.py | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.DASHBOARD_PAT || secrets.GITHUB_TOKEN }} | |
| - name: Build landing (Astro) | |
| run: cd site && bun install --frozen-lockfile && bun run build | |
| - name: Deploy dashboard (landing) to Pages | |
| uses: cloudflare/wrangler-action@v4 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy site/dist --project-name=software-pack-dashboard --branch=main | |
| - name: Deploy routing Worker | |
| uses: cloudflare/wrangler-action@v4 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| workingDirectory: worker | |
| command: deploy |