Skip to content

mainブランチに変更 #8

mainブランチに変更

mainブランチに変更 #8

Workflow file for this run

# Sample workflow for building and deploying a Docusaurus site to GitHub Pages
name: Deploy Docusaurus with GitHub Pages dependencies preinstalled
on:
# masterブランチへのpushに対応する
push:
branches: ["main"]
# プルリクエストでのCIに対応する
pull_request:
types: [opened, synchronize]
# 手動での実行に対応する
workflow_dispatch:
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
# 実行ステップ
steps:
- uses: actions/checkout@v4 # v2 -> v4
# - uses: pnpm/[email protected] # 特定のバージョンを指定せず、最新版を使うことを推奨
- uses: pnpm/action-setup@v3
with:
version: 8
run_install: false # pnpm installを別途実行するため不要
- name: Setup Node.js environment
uses: actions/setup-node@v4 # v3 -> v4
with:
node-version: 20
cache: "pnpm"
# 依存関係のインストール
- name: install dependencies
run: pnpm install --no-frozen-lockfile
working-directory: packages/howreactworks/docs
- name: Build
run: pnpm run build
working-directory: packages/howreactworks/docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3 # v2 -> v3
with:
path: packages/howreactworks/build
# Deployment job
deploy:
# mainブランチのときのみ実行する
if: github.ref == 'refs/heads/main'
# 必要な権限を付与する
permissions:
pages: write # to deploy to Pages
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # v2 -> v4