UserScriptsPublic/.forgejo/workflows/nodejs-ci.yml
Nicholas Phillips 9746b843e2
All checks were successful
Node.js CI / build (push) Successful in 1m8s
Update action from runs-on ubuntu-latest to runs-on docker
2024-08-02 10:28:21 -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: docker
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 }}