Skip to content

Commit

Permalink
ci: CD for auto deploy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxy0551 committed Oct 9, 2024
1 parent 633463f commit 341c26d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Docs CD

on:
push:
branches: [main, deploy]
pull_request:
branches: [main, deploy]

jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 9.7.0

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

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build esm
run: pnpm build

- name: Install website dependencies
run: cd website && pnpm install --frozen-lockfile

- name: Build website
run: npm run deploy
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monaco-sql-languages",
"version": "0.12.2",
"version": "0.12.3-beta.3",
"description": "SQL languages for the Monaco Editor, based on monaco-languages.",
"scripts": {
"prepublishOnly": "npm run build",
Expand All @@ -10,7 +10,7 @@
"test": "npm run build-amd && mocha ./test/all.js",
"dev": "node --max_old_space_size=4092 & cd website && npm run dev",
"prod": "rm -rf ./docs && node --max_old_space_size=4092 & cd website && npm run build",
"deploy": "npm run prod && gh-pages -d docs -r [email protected]:DTStack/monaco-sql-languages.git",
"deploy": "npm run prod && gh-pages -d docs -r [email protected]:liuxy0551/monaco-sql-languages.git",
"format": "prettier --write .",
"prettier-check": "prettier --check .",
"check-types": "tsc -p ./tsconfig.json",
Expand Down

0 comments on commit 341c26d

Please sign in to comment.