Skip to content

Commit

Permalink
ci: add deploy config
Browse files Browse the repository at this point in the history
  • Loading branch information
pure-js committed Aug 16, 2023
1 parent cccd98b commit 7988414
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/deploy-to-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy Release Build to GitHub pages

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

jobs:

# Build job
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run Lint checking
run: pnpm run doc

# Deploy job
deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "eslint src/**/* --ext .ts",
"test": "vitest --coverage --run",
"test:watch": "vitest --coverage",
"doc": "typedoc src/browser-detection.ts"
"doc": "typedoc src/browser-detection.ts --basePath /browser-detection/"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 7988414

Please sign in to comment.