From 52c5e12bb2dfc09cf85584405089080f88568e9e Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Tue, 10 Oct 2023 23:36:22 +0200 Subject: [PATCH] Add workflow to build css and js files --- .github/workflows/build.yml | 71 +++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a6e27d8d --- /dev/null +++ b/.github/workflows/build.yml @@ -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' + 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