Skip to content

Commit

Permalink
Added ci/cd workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Oct 31, 2023
1 parent 0689707 commit 245d7a7
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Continuous Integration

on:
push:
branches:
- main
workflow_call:
workflow_dispatch:
pull_request:
types: [synchronize]

jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: ${{ matrix.os }}
permissions:
contents: read
id-token: write
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Formatting
run: npm run format:check

- name: Linting
run: npm run lint

- name: Build
run: npm run build

docs:
needs: ci
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Build docs
run: npm run build:docs

- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
31 changes: 31 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
release:
types: [created]

jobs:
ci:
uses: ./.github/workflows/ci.yaml
release:
runs-on: ubuntu-latest
needs: ci
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup npm authenication
uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 comments on commit 245d7a7

Please sign in to comment.