2021-11-17 06:27:17 +08:00
|
|
|
name: Publish Website
|
|
|
|
|
|
|
|
on:
|
2023-09-11 17:58:16 +08:00
|
|
|
schedule:
|
|
|
|
- cron: 0 23 * * *
|
2021-12-15 05:05:30 +08:00
|
|
|
workflow_dispatch: {}
|
2021-11-17 06:27:17 +08:00
|
|
|
|
2023-06-05 12:12:09 +08:00
|
|
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
|
|
|
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
|
|
|
concurrency:
|
|
|
|
group: 'pages'
|
|
|
|
cancel-in-progress: false
|
|
|
|
|
2021-11-17 06:27:17 +08:00
|
|
|
jobs:
|
2023-06-05 12:12:09 +08:00
|
|
|
deploy:
|
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
2021-11-17 06:27:17 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-05 12:12:09 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2023-02-10 17:26:28 +08:00
|
|
|
- uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # pin@v2
|
2021-11-17 06:27:17 +08:00
|
|
|
with:
|
2022-03-29 22:18:16 +08:00
|
|
|
node-version: 16
|
2021-11-17 06:27:17 +08:00
|
|
|
- name: Cache node modules
|
|
|
|
id: cacheNodeModules
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: '**/node_modules'
|
2023-02-10 17:26:28 +08:00
|
|
|
key: ${{ runner.os }}-cacheNodeModules2-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: ${{ runner.os }}-cacheNodeModules2-
|
|
|
|
- name: execute `npm ci` (1)
|
2021-11-17 06:27:17 +08:00
|
|
|
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
|
2021-11-23 04:57:39 +08:00
|
|
|
run: npm ci
|
2023-02-10 17:26:28 +08:00
|
|
|
- name: Build
|
2023-02-23 00:39:35 +08:00
|
|
|
run: npm run build-monaco-editor
|
2023-02-10 17:26:28 +08:00
|
|
|
|
|
|
|
- name: Install website node modules
|
|
|
|
working-directory: website
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Install most recent version of monaco-editor
|
|
|
|
working-directory: website
|
|
|
|
run: yarn add monaco-editor
|
|
|
|
|
2021-11-17 06:27:17 +08:00
|
|
|
- name: Build website
|
2023-02-10 17:26:28 +08:00
|
|
|
working-directory: website
|
|
|
|
run: yarn run build
|
2021-11-17 06:27:17 +08:00
|
|
|
|
2023-06-05 12:12:09 +08:00
|
|
|
- name: Setup Pages
|
|
|
|
uses: actions/configure-pages@v3
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-pages-artifact@v1
|
2023-02-10 17:26:28 +08:00
|
|
|
with:
|
2023-06-05 12:12:09 +08:00
|
|
|
# Upload entire repository
|
|
|
|
path: './website/dist'
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v2
|