build yamlをmainからmasterに修正 #16
This file contains hidden or 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: Build and Deploy Jekyll Site | |
on: | |
push: | |
branches: | |
- master # ← GitHub Pages のデプロイ対象ブランチ | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 # 最新の checkout アクションを使用 | |
- name: Install Ruby and Jekyll | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ruby-full build-essential zlib1g-dev | |
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc | |
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc | |
source ~/.bashrc | |
gem install jekyll bundler | |
- name: Install dependencies | |
run: | | |
bundle install | |
- name: Build Jekyll site | |
run: | | |
bundle exec jekyll build --destination ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 # GitHub Pages 用の成果物アップロード | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 # GitHub Pages へデプロイ | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} |