From 6f2dc2894912d522d94a1a0c9606ed55e06c2e1f Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 16 Nov 2021 23:27:17 +0100 Subject: [PATCH] Add publish website workflow --- .github/workflows/website.yml | 38 +++++++++++++++++++++++++++++++++++ package.json | 4 ++-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/website.yml diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml new file mode 100644 index 00000000..e6291759 --- /dev/null +++ b/.github/workflows/website.yml @@ -0,0 +1,38 @@ +name: Publish Website + +on: + push: + branches: + - main + +jobs: + publish-website: + name: Publish Website + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v2 + with: + node-version: 14 + + - name: Cache node modules + id: cacheNodeModules + uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.os }}-cacheNodeModules- + + - name: Install node modules (1) + if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} + run: npm install + + - name: Build website + run: npm run build-website-ci + + - name: Deploy to GitHub Pages + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: git push origin gh-pages --force + working-directory: ../monaco-editor-website diff --git a/package.json b/package.json index 6a9aec3e..60441768 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "license": "MIT", "scripts": { "build-website": "node ./build/website.js && npm run typedoc", + "build-website-ci": "node ./build/website.js && npm run typedoc && node ./build/prepare-website-branch.js", "import-typescript": "node ./build/importTypescript.js", "playwright-install": "node ./node_modules/playwright/install.js", "playwright-install-deps": "playwright install-deps", @@ -20,8 +21,7 @@ "smoketest": "node ./test/smoke/runner.js", "test": "node ./test/unit/all.js", "typedoc": "cd website/typedoc && \"../../node_modules/.bin/typedoc\" --options ./typedoc.json", - "watch": "tsc -w -p ./src", - "website": "node ./build/website.js && npm run typedoc && node ./build/prepare-website-branch.js" + "watch": "tsc -w -p ./src" }, "typings": "./esm/vs/editor/editor.api.d.ts", "module": "./esm/vs/editor/editor.main.js",