Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ jobs:

- name: Deploy to Staging
if: github.event_name == 'push'
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: deploy --env staging --outdir=./dist --upload-source-maps --var SENTRY_RELEASE:$(npx sentry-cli releases propose-version)
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
run: node --run deploy:staging

- name: Deploy to Production
if: github.event_name == 'workflow_dispatch'
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: deploy --env prod --outdir=./dist --upload-source-maps --var SENTRY_RELEASE:$(npx sentry-cli releases propose-version)
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
run: node --run deploy:prod

- name: Upload Source Maps to Sentry
env:
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"test": "vitest --run",
"test:watch": "vitest",
"build:mustache": "node scripts/compile-mustache.mjs",
"build:workers-types": "wrangler types --include-env=false && node --run format"
"build:workers-types": "wrangler types --include-env=false && node --run format",
"deploy:prod": "wrangler deploy --env prod --outdir=./dist --upload-source-maps --var SENTRY_RELEASE:$(npx sentry-cli releases propose-version)",
"deploy:staging": "wrangler deploy --env staging --outdir=./dist --upload-source-maps --var SENTRY_RELEASE:$(npx sentry-cli releases propose-version)"
},
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.10.1",
Expand Down
6 changes: 2 additions & 4 deletions scripts/upload-sourcemaps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ fi

SENTRY_RELEASE=$(npx sentry-cli releases propose-version)

echo Creating release $SENTRY_RELEASE

npx sentry-cli releases new $SENTRY_RELEASE
--org=$SENTRY_ORG
npx sentry-cli releases new $SENTRY_RELEASE \
--org=$SENTRY_ORG \
--project=$SENTRY_PROJECT

# Associate the commits since last release with this release
Expand Down