feat: github login #51
Workflow file for this run
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: Preview Deployment | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: [main] | |
| jobs: | |
| deploy-preview: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| permissions: | |
| contents: read | |
| deployments: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Wrangler | |
| run: pnpm add -D wrangler@4 | |
| - name: Build Astro | |
| run: | | |
| pnpm generate:data | |
| pnpm generate:og | |
| pnpm build | |
| - name: Deploy Preview Worker | |
| id: deploy | |
| run: | | |
| cd dist/server | |
| npx wrangler deploy --config wrangler.json --name 4byte-dev-pr-${{ github.event.pull_request.number }} | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| - name: Add PR Comment | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| header: preview-url | |
| message: | | |
| **Preview Deployment is Ready!** | |
| https://4byte-dev-pr-${{ github.event.pull_request.number }}.<your-subdomain>.workers.dev |