Update tests #2
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 Worker | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
strategy: | |
matrix: | |
node-version: [ 20 ] | |
steps: | |
- uses: actions/checkout@v4 | |
# Install Node | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- name: Confirm installed Node version | |
run: node -v | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm run test | |
deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build & Deploy Worker | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |