Skip to content

Merge branch 'main' into demo #16

Merge branch 'main' into demo

Merge branch 'main' into demo #16

Workflow file for this run

name: build-and-deploy-github-pages
on:
push:
branches:
- demo
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
# https://docs.github.com/ja/actions/using-workflows/caching-dependencies-to-speed-up-workflows
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }}
run: yarn install
- name: Build React
run: yarn build:demo
- uses: actions/upload-pages-artifact@v1
with:
path: ./dist
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2