-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (28 loc) · 929 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Jekyll site CI
on:
push:
branches:
- staging # Set this to your default branch
pull_request:
branches:
- staging # 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