mirror of
https://github.com/apophenia-news/apophenia.news.git
synced 2026-03-16 19:01:02 +00:00
Feat: GH Action to build and commit dist to main
This commit is contained in:
36
.github/workflows/build.yml
vendored
Normal file
36
.github/workflows/build.yml
vendored
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user