Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/webpack-main-build-and-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Webpack Build Production & Commit (Node.js)
description: 'This workflow triggers a Node.js build on push or manually: it reads the Node version from Build/.nvmrc, checks out the code, installs dependencies via npm ci, runs the production Webpack build, and commits the built assets back to the repository.'

on:
push:
branches: [ "main" ]
workflow_dispatch:

jobs:
build-and-commit:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: 'Build/.nvmrc'

- name: Install Dependencies from package-lock.json
working-directory: Build
run: npm ci

- name: Run Webpack Build for Production
working-directory: Build
run: npm run build

# needs to be adjusted after changes in the webpack.config output paths
# filename: 'JavaScript/DlfMediaPlayer/[name].js'
# filename: "Css/[name].css",
- name: Commit and Push Built Assets
run: |
git config --global user.name "webpack-builder[bot]"
git config --global user.email "webpack-builder[bot]@users.noreply.github.com"

git add Resources/Public/JavaScript/DlfMediaPlayer
git add Resources/Public/Css

if git diff --cached --quiet; then
echo "No changes to commit."
else
git commit -m "build: update webpack built assets [ci skip]"
git push
fi
27 changes: 27 additions & 0 deletions .github/workflows/webpack-pr-build-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Webpack Build Check (Node.js)
description: 'This workflow triggers a Node.js build on a Pull Request to main to check the workflow: it reads the Node version from Build/.nvmrc, checks out the code, installs dependencies via npm ci, and runs the production Webpack build.'

on:
pull_request:
branches: [ "main" ]

jobs:
build-check:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: 'Build/.nvmrc'

- name: Install Dependencies from package-lock.json
working-directory: Build
run: npm ci

- name: Run Webpack Build for Production (Check Only)
working-directory: Build
run: npm run build
72 changes: 36 additions & 36 deletions Build/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.