Add publish website workflow

This commit is contained in:
Alex Dima 2021-11-16 23:27:17 +01:00
parent 903a92c7bb
commit 6f2dc28949
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
2 changed files with 40 additions and 2 deletions

38
.github/workflows/website.yml vendored Normal file
View file

@ -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