Merge pull request #18 from jmlntw/github_actions/actions/configure-p… #26
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: GitHub Pages | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: pages | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Ruby environment | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.0 | |
bundler-cache: true | |
cache-version: 0 | |
- name: Set up GitHub Pages | |
id: pages | |
uses: actions/configure-pages@v4 | |
- name: Build GitHub Pages | |
env: | |
JEKYLL_ENV: production | |
LC_ALL: C.UTF-8 | |
run: | | |
bundle exec jekyll build \ | |
--destination _site \ | |
--baseurl "${{ steps.pages.outputs.base_path }}" | |
- name: Upload GitHub Pages to artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: _site | |
deploy: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |