Skip to content

Commit 3a11048

Browse files
committed
Replace deprecated jekyll action
...with a custom github action Github seem to have completely changed how they handle deploying static sites
1 parent 6436b67 commit 3a11048

File tree

1 file changed

+43
-16
lines changed

1 file changed

+43
-16
lines changed

.github/workflows/github-pages.yml

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,52 @@ name: Build and deploy Jekyll site to GitHub Pages
33
on:
44
push:
55
branches:
6-
- main
6+
- "main"
7+
workflow_dispatch:
78

8-
jobs:
9-
github-pages:
10-
runs-on: ubuntu-latest
9+
permissions:
10+
contents: "read"
11+
pages: "write"
12+
id-token: "write"
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
1117

18+
jobs:
19+
build:
20+
runs-on: "ubuntu-latest"
1221
steps:
13-
- name: Checkout repo
14-
uses: actions/checkout@v5
22+
- name: "Checkout repo"
23+
uses: "actions/checkout@v5"
1524

16-
- name: Get cached gems
17-
uses: actions/cache@v5
25+
- name: "Setup Ruby"
26+
uses: "ruby/setup-ruby@v1"
1827
with:
19-
path: vendor/bundle
20-
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
21-
restore-keys: |
22-
${{ runner.os }}-gems-
23-
- name: Build and deploy
24-
uses: helaili/jekyll-action@v2
28+
bundler-cache: true
29+
30+
- name: "Setup Pages"
31+
id: "pages"
32+
uses: "actions/configure-pages@v5"
33+
34+
- name: "Build with Jekyll"
35+
run: 'bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"'
36+
env:
37+
JEKYLL_ENV: "production"
38+
39+
- name: "Upload Pages artifact"
40+
uses: "actions/upload-pages-artifact@v3"
2541
with:
26-
token: ${{ secrets.GITHUB_TOKEN }}
27-
target_branch: 'gh-pages'
42+
path: "_site"
43+
44+
deploy:
45+
runs-on: "ubuntu-latest"
46+
needs: "build"
47+
environment:
48+
name: "github-pages"
49+
url: "${{ steps.deployment.outputs.page_url }}"
50+
steps:
51+
- name: "Deploy to GitHub Pages"
52+
id: "deployment"
53+
uses: "actions/deploy-pages@v4"
54+

0 commit comments

Comments
 (0)