Deploy Cloudflare Workers #965
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: Deploy Cloudflare Workers | |
on: | |
workflow_run: | |
workflows: ['CI'] | |
types: [completed] | |
branches: [main] | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
GITHUB_SHA: ${{ github.sha }} | |
TURBO_TOKEN: ${{ secrets.TURBOREPO_REMOTE_CACHE_AUTH_SECRET }} | |
TURBO_API: 'https://turbo-cache.adishwar-rishi.com' | |
TURBO_TEAM: 'team_arishi_monorepo' | |
TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBOREPO_REMOTE_CACHE_SIGNATURE_KEY }} | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
check: | |
name: Build and deploy CF Workers | |
runs-on: ubuntu-latest | |
if: github.event.workflow_run.conclusion == 'success' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- run: pnpm install | |
- run: pnpm build | |
- name: Deploy domain-redirect worker | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
accountId: ${{ secrets.CF_ACCOUNT_ID }} | |
command: deploy --minify | |
workingDirectory: 'cf-workers/domain-redirect' | |
packageManager: 'pnpm' | |
- name: Deploy arishi-website-api worker | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
accountId: ${{ secrets.CF_ACCOUNT_ID }} | |
command: deploy --minify | |
workingDirectory: 'cf-workers/website-api' | |
packageManager: 'pnpm' |