Skip to content

Commit

Permalink
Automate worker deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
iWader committed Nov 9, 2023
1 parent 29cf21b commit 1ff9c7d
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/stats.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
workflow_dispatch:

push:
branches:
- main

jobs:
build-worker:
name: Build Worker
runs-on: ubuntu-latest

env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
CLOUDFLARE_KV_NAMESPACE_ID: ${{ secrets.CLOUDFLARE_KV_NAMESPACE_ID }}

steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.13

- name: Check out
uses: actions/checkout@v3

- name: Install Node Dependencies
run: npm install

- name: Run Tests
run: npm test

- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_KEY }}
command: deploy workers/stats/src/index.ts --name=stat

0 comments on commit 1ff9c7d

Please sign in to comment.