Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 0 additions & 144 deletions .circleci/config.yml

This file was deleted.

7 changes: 5 additions & 2 deletions .circleci/scripts/deploy-docs.sh β†’ .github/scripts/deploy-docs.sh
100644 β†’ 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ red(){
>&2 printf "\e[31m$1\e[39m\n"
}

export PROJECT_NAME="${PROJECT_NAME:-$CIRCLE_PROJECT_REPONAME}"
export PROJECT_NAME="${PROJECT_NAME:-$GITHUB_REPOSITORY}"
if [[ -z "$PROJECT_NAME" ]]; then
red "PROJECT_NAME not set and could not be derived from CIRCLE_PROJECT_REPONAME"
red "PROJECT_NAME not set and could not be derived from GITHUB_REPOSITORY"
exit 1
fi

# Strip the org prefix if GITHUB_REPOSITORY was used (e.g. "org/repo" -> "repo")
PROJECT_NAME="${PROJECT_NAME##*/}"
green "PROJECT_NAME: $PROJECT_NAME"

export BUILD_DIR="${BUILD_DIR:-website}"
Expand Down
File renamed without changes.
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: CI

on:
push:
branches:
- '**'
tags:
- '**'
pull_request:

jobs:
test:
name: Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22]
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test

- name: Upload coverage to Coveralls
if: matrix.node-version == 20
run: cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
continue-on-error: true

deploy-docs:
name: Deploy Docs
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master' || github.ref == 'refs/tags/stg'
environment: Documentation
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: website/package-lock.json

- name: Install AWS CLI
run: sudo apt-get -y install awscli

- name: Deploy docs
run: bash ./.github/scripts/deploy-docs.sh
env:
PROJECT_NAME: ${{ github.event.repository.name }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}

deploy-package:
name: Publish to npm
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref_name, '.')
environment: npm-publish
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm install

- name: Publish to npm
run: |
if [[ "${{ github.ref_name }}" = *-* ]]; then
npm publish --tag=prerelease
else
npm publish
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint": "eslint lib cli index.js",
"test": "npm run lint && jest",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"release": "./.circleci/scripts/release.sh",
"release": "./.github/scripts/release.sh",
"watch": "jest --watch"
},
"jest": {
Expand Down
Loading