From 341c26d072cd85e873cbd49f471f4eae4583364b Mon Sep 17 00:00:00 2001 From: liuxy0551 Date: Wed, 9 Oct 2024 18:17:28 +0800 Subject: [PATCH] ci: CD for auto deploy docs --- .github/workflows/cd.yml | 45 ++++++++++++++++++++++++++++++++++++++++ package.json | 4 ++-- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 00000000..78753f38 --- /dev/null +++ b/.github/workflows/cd.yml @@ -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/action-setup@v4.0.0 + 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 diff --git a/package.json b/package.json index 040f2af8..63462b51 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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 git@github.com:DTStack/monaco-sql-languages.git", + "deploy": "npm run prod && gh-pages -d docs -r git@github.com:liuxy0551/monaco-sql-languages.git", "format": "prettier --write .", "prettier-check": "prettier --check .", "check-types": "tsc -p ./tsconfig.json",