Skip to content

Merge pull request #25 from Cherry/dependabot/npm_and_yarn/vite-5.4.6 #87

Merge pull request #25 from Cherry/dependabot/npm_and_yarn/vite-5.4.6

Merge pull request #25 from Cherry/dependabot/npm_and_yarn/vite-5.4.6 #87

Workflow file for this run

name: Build
on:
push:
pull_request:
repository_dispatch:
env:
NODE_VERSION: 20.x
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 60
# always run in pull request, or repository_dispatch
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'repository_dispatch'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore NPM cache
uses: actions/cache@v4
continue-on-error: true
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm run test
deploy:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: test
# only run if in main
if: github.ref == 'refs/heads/main' && (github.event_name == 'repository_dispatch' || github.event_name == 'push')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore NPM cache
uses: actions/cache@v4
continue-on-error: true
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Deploy
# only publish if a direct `push`/`repository_dispatch`
uses: cloudflare/[email protected]
if: github.event_name == 'repository_dispatch' || github.event_name == 'push'
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
secrets: |
AUTH_KEY
env:
AUTH_KEY: ${{ secrets.AUTH_KEY }}