integrate with swynx #73
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 Worker | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| swynx: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for git diff | |
| - uses: swynx-io/swynx-action@v1 | |
| with: | |
| fail-on-new-dead-code: true | |
| deploy: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build & Deploy Worker | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| command: deploy --outdir dist --upload-source-maps --var SENTRY_RELEASE:${{ github.sha }} | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| - name: Install Sentry CLI | |
| run: curl -sL https://sentry.io/get-cli/ | sh | |
| - name: Upload sourcemaps to Sentry | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| SENTRY_RELEASE: ${{ github.sha }} | |
| run: sentry-cli releases new $SENTRY_RELEASE --org=nn1dev --project=api && sentry-cli sourcemaps upload --org=nn1dev --project=api --release=$SENTRY_RELEASE --strip-prefix 'dist/..' dist |