Merge pull request #2124 from IanDelMar/build-assets-workflow

Add workflow to build css and js files
This commit is contained in:
Brian Coords 2023-10-11 07:37:03 -07:00 committed by GitHub
commit c9efe6b998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 71 additions and 0 deletions

71
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,71 @@
name: Build CSS & JS
on:
push:
branches: [ develop ]
paths:
- '**.scss'
- '**.js'
- 'package-lock.json'
pull_request:
branches: [ develop ]
paths:
- '**.scss'
- '**.js'
- 'package-lock.json'
workflow_dispatch:
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
build:
name: 'Build CSS & JS'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm ci
- name: Copy assets
run: npm run copy-assets
- name: Commit assets
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update assets
- name: Build Bootstrap 5 CSS
run: npm run css
- name: Build Bootstrap 5 JS
run: npm run js
- name: Build Bootstrap 4 CSS
run: npm run css-bs4
- name: Build Bootstrap 5 JS
run: npm run js-bs4
- name: Commit CSS and JS files
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Rebuild CSS and JS files