From 06716412bc29fed12e2ecb22538be69132f78b16 Mon Sep 17 00:00:00 2001 From: Ben Halverson Date: Tue, 3 Sep 2024 22:45:05 -0700 Subject: [PATCH] added github actions --- .github/workflows/nodejs.yaml | 29 ++++++++++++++++++++++++++ .github/workflows/wrangler-action.yaml | 16 ++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/nodejs.yaml create mode 100644 .github/workflows/wrangler-action.yaml diff --git a/.github/workflows/nodejs.yaml b/.github/workflows/nodejs.yaml new file mode 100644 index 0000000..0764723 --- /dev/null +++ b/.github/workflows/nodejs.yaml @@ -0,0 +1,29 @@ +name: Node.js CI + +on: + push: + branches: + - main + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Install Node.js dependencies + run: npm ci + + - name: Run tests + run: npm test diff --git a/.github/workflows/wrangler-action.yaml b/.github/workflows/wrangler-action.yaml new file mode 100644 index 0000000..37a630c --- /dev/null +++ b/.github/workflows/wrangler-action.yaml @@ -0,0 +1,16 @@ +name: Deploy +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + name: Deploy + steps: + - uses: actions/checkout@v4 + - name: Deploy + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}