fix: configure action to build site #1
Workflow file for this run
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: Jekyll site CI | |
on: | |
push: | |
branches: | |
- staging # Set this to your default branch | |
pull_request: | |
branches: | |
- main # Set this to your default branch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.0.2 # Choose the Ruby version compatible with your Jekyll site | |
- name: Build and test | |
run: | | |
gem install bundler | |
bundle install | |
bundle exec jekyll build | |
- name: Deploy to GitHub Pages - staging | |
if: github.ref == 'refs/heads/staging' # This ensures the deploy step only runs on push events to the main branch | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_site # This is the default build directory for Jekyll |