Skip to content

Commit

Permalink
ci: Add deploy & tests actions
Browse files Browse the repository at this point in the history
  • Loading branch information
seabeya committed Mar 21, 2024
1 parent 89c5e91 commit 8b75805
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy

on:
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Deploy to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Publish
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: 'out'
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests

on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, synchronize, reopened]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Install dependencies
run: npm ci

- name: Format
run: npm run prettier:report

- name: Lint
run: npm run lint

- name: Unit test
run: npm run test

0 comments on commit 8b75805

Please sign in to comment.