Skip to content

Development

Development #1

name: Build and commit web assets (JS + CSS)
on:
pull_request:
branches: ["main", "development"]
paths:
- "src/Dfe.ContentSupport.Web.Node/**"
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
build-web-resouces:
name: Build JS and SCSS files
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/Dfe.ContentSupport.Web.Node/
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "latest"
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ `git status --porcelain` ]]; then
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am "Updated JS + CSS files"
git push
echo "Commited changes"
else
echo "No changes to commit"
fi