forked from DigiLive/mushroom-strategy
72 lines
1.7 KiB
YAML
72 lines
1.7 KiB
YAML
name: Build distribution with Webpack
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
detect-source-changes:
|
|
name: Detect Source Changes
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
source_changed: ${{ steps.check_files.outputs.any_changed }}
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
|
|
|
|
- name: Check for changed files in src or webpack.config.js
|
|
id: check_files
|
|
uses: tj-actions/changed-files@v40
|
|
with:
|
|
files: |
|
|
src/**
|
|
webpack.config.js
|
|
|
|
build:
|
|
name: Build Distribution
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CI_COMMIT_MESSAGE: |
|
|
Continuous Integration - Build Distribution
|
|
|
|
[skip codacy]
|
|
CI_COMMIT_AUTHOR: Continuous Integration
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [22.x]
|
|
|
|
needs: detect-source-changes
|
|
if: needs.detect-source-changes.outputs.source_changed == 'true'
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
|
|
|
|
# Build steps
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Node Install
|
|
run: npm ci
|
|
|
|
- name: Build Distribution
|
|
run: |
|
|
npm run build
|
|
|
|
- name: Commit Distribution Build
|
|
run: |
|
|
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
|
|
git config --global user.email "ci_activity@noreply.github.com"
|
|
git add dist
|
|
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
|
|
git push
|