🐛 Fix wrangler deploy >_< #10
This file contains 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: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
CI: true | |
ACTIONS_RUNNER_DEBUG: true | |
jobs: | |
deploy: | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
node-version: ['lts/*'] | |
pnpm-version: ['latest'] | |
os: ['ubuntu-latest'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: 🔑 Checkout | |
uses: actions/checkout@v3 | |
- name: 🥐 Setup pnpm [${{ matrix.pnpm-version}}] | |
uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: ${{ matrix.pnpm-version }} | |
- name: ⎔ Setup Node.js [${{ matrix.node-version }}] | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'pnpm' | |
- name: '📦 Install Dependencies' | |
run: pnpm install --frozen-lockfile | |
- name: '🧹 Lint' | |
run: pnpm lint | |
- name: '🧹 Format' | |
run: pnpm format | |
- name: '🧪 Typecheck' | |
run: pnpm typecheck | |
- name: '🔧 Build' | |
run: pnpm build | |
- name: '🔸 Cloudflare Workers - Deploy 🚀' | |
uses: cloudflare/wrangler-action@2.0.0 | |
with: | |
workingDirectory: ./apps/api | |
command: deploy ./src/index.ts --name 'balance' --experimental-json-config --config='wrangler.json' --tsconfig='tsconfig.json' --latest --compatibility-date='2023-07-01' --outdir='dist' --var NODE_ENV:'production' | |
wranglerVersion: 'beta' | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
preCommands: echo "Deploying API to Cloudflare Workers" | |
postCommands: echo "Deployed API to Cloudflare Workers" | |
secrets: | | |
INFURA_KEY | |
LLAMANODES_API_KEY | |
ANKR_API_KEY | |
CHAINNODES_API_KEY | |
SENTRY_DSN | |
env: | |
NODE_ENV: 'production' | |
INFURA_KEY: ${{ secrets.INFURA_KEY }} | |
LLAMANODES_API_KEY: ${{ secrets.LLAMANODES_API_KEY }} | |
ANKR_API_KEY: ${{ secrets.ANKR_API_KEY }} | |
CHAINNODES_API_KEY: ${{ secrets.CHAINNODES_API_KEY }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} |