Skip to content

Commit 384dbb3

Browse files
committed
Update jekyll-gh-pages.yml
1 parent 6e090c1 commit 384dbb3

File tree

1 file changed

+47
-25
lines changed

1 file changed

+47
-25
lines changed
Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,50 @@
1+
name: Build and deploy this site to GitHub Pages
2+
13
on:
2-
push:
3-
branches: [ master ]
4-
pull_request:
5-
branches: [ master ]
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
612

713
jobs:
8-
build:
9-
10-
runs-on: ubuntu-latest
11-
12-
steps:
13-
- uses: actions/checkout@v2
14-
- name: Install Dependencies
15-
run: npm install
16-
17-
- name: Build the site in the jekyll/builder container
18-
run: |
19-
docker run \
20-
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
21-
jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future"
22-
23-
- name: GitHub Pages
24-
uses: crazy-max/[email protected]
25-
with:
26-
build_dir: _site/
27-
env:
28-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
github-pages:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
# Step 1: Check out the code
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
# Step 2: Setup Ruby environment
23+
- name: Setup Ruby
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: 3.1
27+
bundler-cache: true
28+
29+
# Step 3: Setup Node.js environment
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v3
32+
with:
33+
node-version: '18'
34+
35+
# Step 4: Install dependencies
36+
- name: Install dependencies
37+
run: npm install
38+
39+
# Step 5: Build the Jekyll site
40+
- name: Build Jekyll site
41+
uses: limjh16/jekyll-action-ts@v2
42+
with:
43+
enable_cache: true
44+
45+
# Step 6: Deploy to GitHub Pages
46+
- name: Deploy to GitHub Pages
47+
uses: peaceiris/actions-gh-pages@v4
48+
with:
49+
github_token: ${{ secrets.GITHUB_TOKEN }}
50+
publish_dir: ./_site

0 commit comments

Comments
 (0)