-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (45 loc) · 1.43 KB
/
build_jekyll_with_pagefind.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
35
36
37
38
39
40
41
42
43
44
45
name: Build Jekyll Site with Pagefind
on:
push:
branches: ["master"]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build
uses: actions/jekyll-build-pages@v1
- name: Get Actions user id
id: get_uid
run: |
actions_user_id=`id -u $USER`
echo $actions_user_id
echo "uid=$actions_user_id" >> $GITHUB_OUTPUT
- name: Correct Ownership in GITHUB_WORKSPACE directory
uses: peter-murray/reset-workspace-ownership-action@v1
with:
user_id: ${{ steps.get_uid.outputs.uid }}
- name: Index pagefind
run: |
wget https://github.com/CloudCannon/pagefind/releases/download/${{ vars.PAGEFIND_VERSION }}/${{ vars.PAGEFIND_PACKAGE_NAME }}
tar -xvzf ${{ vars.PAGEFIND_PACKAGE_NAME }}
./pagefind_extended --site ${{ github.workspace }}/_site --exclude-selectors "img.emoji" --glob blog/post/**/*.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}