diff --git a/.github/workflows/denylist.yml b/.github/workflows/denylist.yml new file mode 100644 index 0000000..9ffd4d7 --- /dev/null +++ b/.github/workflows/denylist.yml @@ -0,0 +1,107 @@ +name: denylist +on: + push: + branches: + - main + paths: + - 'packages/denylist/**' + - '.github/workflows/denylist.yml' + - 'pnpm-lock.yaml' + pull_request: + paths: + - 'packages/denylist/**' + - '.github/workflows/denylist.yml' + - 'pnpm-lock.yaml' +jobs: + check: + runs-on: ubuntu-latest + name: Test + steps: + - uses: actions/checkout@v2 + - uses: pnpm/action-setup@v2.0.1 + with: + version: 6.32.x + - uses: actions/setup-node@v2 + - run: pnpm install + - run: pnpm build:denylist + - name: Lint + run: pnpm lint + test: + runs-on: ubuntu-latest + name: Test + steps: + - uses: actions/checkout@v2 + - uses: pnpm/action-setup@v2.0.1 + with: + version: 6.32.x + - uses: actions/setup-node@v2 + - run: pnpm install + - run: pnpm test:denylist + deploy-staging: + name: Deploy Staging + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v2 + - uses: pnpm/action-setup@v2.0.1 + with: + version: 6.32.x + - uses: actions/setup-node@v2 + with: + cache: 'pnpm' + - run: pnpm install + - name: Publish app + uses: cloudflare/wrangler-action@2.0.0 + env: + ENV: 'staging' # inform the build process what the env is + SENTRY_TOKEN: ${{secrets.SENTRY_TOKEN}} + SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }} + with: + apiToken: ${{secrets.CF_GATEWAY_TOKEN }} + workingDirectory: 'packages/denylist' + environment: 'staging' + changelog: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + name: Release + runs-on: ubuntu-latest + outputs: + releases_created: ${{ steps.tag-release.outputs.releases_created }} + steps: + - uses: GoogleCloudPlatform/release-please-action@v3 + id: tag-release + with: + path: packages/denylist + token: ${{ secrets.GITHUB_TOKEN }} + release-type: node + monorepo-tags: true + package-name: denylist + release: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changelog.outputs.releases_created + name: Release + runs-on: ubuntu-latest + needs: + - check + - test + - changelog + steps: + - uses: actions/checkout@v2 + - uses: pnpm/action-setup@v2.0.1 + with: + version: 6.32.x + - uses: actions/setup-node@v2 + with: + cache: 'pnpm' + node-version: 16 + registry-url: 'https://registry.npmjs.org' + - run: pnpm install + - name: Deploy + uses: cloudflare/wrangler-action@2.0.0 + env: + ENV: 'production' # inform the build process what the env is + SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }} + SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }} + with: + apiToken: ${{ secrets.CF_GATEWAY_TOKEN }} + workingDirectory: 'packages/denylist' + environment: 'production' diff --git a/packages/denylist/src/env.js b/packages/denylist/src/env.js index 29a62ab..42b3b49 100644 --- a/packages/denylist/src/env.js +++ b/packages/denylist/src/env.js @@ -20,7 +20,6 @@ export function envAll (request, env, ctx) { env.COMMITHASH = COMMITHASH env.SENTRY_RELEASE = SENTRY_RELEASE env.sentry = getSentry(request, env, ctx) - env.log.time('request') } /**