UserScriptsPublic/.forgejo/workflows/nodejs-ci.yml
Nicholas Phillips 81b336ff1a
Some checks are pending
Node.js CI / build (push) Waiting to run
Initial push (copy from private UserScripts)
2024-08-02 10:24:49 -04:00

46 lines
1 KiB
YAML

name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: "0 0 */1 * *" # Every day at midnight UTC
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '21.5.0'
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
- name: Temporarily allow build directory
run: |
sed -i '/^build\//d' .gitignore
- name: Stage build artifacts
run: |
git add build/
git restore --staged .gitignore
- name: Commit and push changes
run: |
git config --global user.name 'forgejo-actions[bot]'
git config --global user.email 'forgejo-actions[bot]@forgejo.localhost'
git commit -m 'Build and commit changes'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}