Skip to content

Initial Hono + D1 rewrite #89

Initial Hono + D1 rewrite

Initial Hono + D1 rewrite #89

Workflow file for this run

on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/[email protected]
with:
node-version: 20
- name: Get cache directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache node_modules
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
working-directory: ./worker
run: |
yarn install --dev
yarn global add wrangler
- name: Migrate database
working-directory: ./worker
run: wrangler d1 migrations apply DB --local
- name: Lint
working-directory: ./worker
run: yarn run lint
- name: Test
working-directory: ./worker
run: yarn run test
deploy:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Publish
uses: web3-storage/wrangler-action@node16
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
workingDirectory: ./worker