chore: bump dependencies #88
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: 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 }} |