From 784cceb48a0c98f49e39f6a4b1e3a5b1a44908be Mon Sep 17 00:00:00 2001 From: dichgrem Date: Sun, 23 Nov 2025 19:15:06 +0800 Subject: [PATCH] feat:zola_actions --- .github/workflows/build.yml | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7d31ca2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: Blog CI (Zola) + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Zola + uses: taiki-e/install-action@v2 + with: + tool: zola + + - name: Install Pagefind + run: | + wget https://github.com/Pagefind/pagefind/releases/download/v1.4.0/pagefind-v1.4.0-x86_64-unknown-linux-musl.tar.gz + tar xvf pagefind-v1.4.0-x86_64-unknown-linux-musl.tar.gz + sudo mv pagefind /usr/local/bin/ + + - name: Build Zola + run: zola build + + - name: Build Pagefind + run: pagefind --site public --root-selector body + + - name: Push public to dist + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public + publish_branch: dist +