From 4158f2116757c6456cda0e4c4f455a5bba522060 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Tue, 24 Feb 2026 18:40:10 -0800 Subject: [PATCH] Feat: GH Action to build and commit dist to main --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 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..3ba7dfa --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build & Commit dist + +on: + push: + branches: [main] + paths: + - articles/** + - templates/** + - static/** + - build.js + - package.json + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - run: npm ci + + - run: npm run build + + - name: Commit dist + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add dist/ -f + git diff --staged --quiet && echo "No changes" && exit 0 + git commit -m "build: update dist [skip ci]" + git push