48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
name: Build presences
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "presences/**"
|
|
- "scripts/**"
|
|
- "package.json"
|
|
- "package-lock.json"
|
|
- ".gitea/workflows/build.yml"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Build all presences
|
|
run: npm run build
|
|
|
|
- name: Generate index.json
|
|
run: npm run index
|
|
|
|
- name: Commit and push artifacts
|
|
env:
|
|
BUILD_USER: gitea-actions
|
|
BUILD_EMAIL: actions@gits.hibna.com.tr
|
|
run: |
|
|
git config user.name "$BUILD_USER"
|
|
git config user.email "$BUILD_EMAIL"
|
|
git add presences/*/dist/presence.js index.json
|
|
if git diff --cached --quiet; then
|
|
echo "No build artifacts changed."
|
|
exit 0
|
|
fi
|
|
git commit -m "ci: rebuild presence artifacts"
|
|
git push origin HEAD:main
|