mirror of
https://github.com/litruv/lit.ruv.wtf.git
synced 2026-07-24 02:36:02 +10:00
34 lines
927 B
YAML
34 lines
927 B
YAML
name: Build Site
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
if: github.actor != 'github-actions[bot]' && github.ref == 'refs/heads/main'
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Build site
|
|
run: node build.js
|
|
|
|
- name: Commit and push changes
|
|
run: |
|
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
git config --local user.name "github-actions[bot]"
|
|
# Add all HTML files in the website directory
|
|
git add -- 'website/*.html'
|
|
# Only commit if there are staged changes
|
|
git diff --staged --quiet || git commit -m "Automated build: Update generated site files"
|
|
git push
|