Deploy to gh-pages #94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to gh-pages | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
paths: | |
- simulator | |
- web | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Cache node modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ hashFiles('**/package-lock.json') }} | |
- name: Install | |
run: npm install | |
- name: CD | |
run: | | |
git config --global user.name $user_name | |
git config --global user.email $user_email | |
git remote set-url origin https://${github_token}@github.com/${repository} | |
npm run build | |
npm run -w web deploy | |
env: | |
user_name: "github-actions[bot]" | |
user_email: "github-actions[bot]@users.noreply.github.com" | |
github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} | |
repository: ${{ github.repository }} |