Handle all response codes that could include a Location header
#159
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: Cloudflare Wrangler Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| release: | |
| types: [created] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| name: Build and Test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 22 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - run: npm ci | |
| - run: npm run build --if-present | |
| - run: npm test | |
| - uses: actions/upload-artifact@v4 # upload test results | |
| if: success() || failure() # run this step even if previous step failed | |
| with: | |
| name: test-results | |
| path: junit-report.xml | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/[email protected] | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| beta-deploy: | |
| runs-on: ubuntu-latest | |
| needs: [test] | |
| if: github.event_name == 'push' | |
| name: Deploy to Beta | |
| environment: beta | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Deploy | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| wranglerVersion: 4 | |
| command: deploy --env beta | |
| prod-deploy: | |
| runs-on: ubuntu-latest | |
| needs: [test] | |
| if: github.event_name == 'release' | |
| name: Deploy to PROD | |
| strategy: | |
| matrix: | |
| environment: ['public', 'eus1', 'global'] | |
| environment: ${{ matrix.environment }} | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Deploy | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| wranglerVersion: 4 | |
| command: deploy --env ${{ matrix.environment }} |