chore: only run commit web project build on develop
This commit is contained in:
30
.github/workflows/javascript-format-build.yml
vendored
30
.github/workflows/javascript-format-build.yml
vendored
@@ -11,7 +11,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
formatting:
|
formatting:
|
||||||
name: Javascript code formatting
|
name: Code formatting
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@@ -44,6 +44,18 @@ jobs:
|
|||||||
- '**.css'
|
- '**.css'
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
|
||||||
|
- name: Cache node modules
|
||||||
|
uses: actions/cache@v3
|
||||||
|
env:
|
||||||
|
cache-name: cache-node-modules-bundle-web-app
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('web/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-build-
|
||||||
|
${{ runner.os }}-
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
@@ -85,6 +97,18 @@ jobs:
|
|||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Cache node modules
|
||||||
|
uses: actions/cache@v3
|
||||||
|
env:
|
||||||
|
cache-name: cache-node-modules-bundle-web-app
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('web/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-build-
|
||||||
|
${{ runner.os }}-
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
@@ -95,6 +119,7 @@ jobs:
|
|||||||
# and bundle step. This both will verify that the build is successful as
|
# and bundle step. This both will verify that the build is successful as
|
||||||
# well as commiting the updated static files into the repository for use.
|
# well as commiting the updated static files into the repository for use.
|
||||||
web-bundle:
|
web-bundle:
|
||||||
|
name: Build and bundle web project
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'owncast/owncast'
|
if: github.repository == 'owncast/owncast'
|
||||||
|
|
||||||
@@ -120,8 +145,11 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- run: build/web/bundleWeb.sh
|
- run: build/web/bundleWeb.sh
|
||||||
|
|
||||||
|
# Only commit built web project files on develop.
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
|
if: ${{ github.ref == 'refs/heads/develop' && env.GH_CR_PAT != null }}
|
||||||
uses: EndBug/add-and-commit@v9
|
uses: EndBug/add-and-commit@v9
|
||||||
|
|
||||||
with:
|
with:
|
||||||
pull: --rebase --autostash
|
pull: --rebase --autostash
|
||||||
message: 'Bundle embedded web app'
|
message: 'Bundle embedded web app'
|
||||||
|
|||||||
Reference in New Issue
Block a user