Pipeline fix?
All checks were successful
Build and Deploy / Build and Deploy (push) Successful in 47s

This commit is contained in:
Bob Vandevliet 2025-11-26 16:12:02 +01:00
parent e6326b5f25
commit 82dcb2b952

View file

@ -1,14 +1,14 @@
name: Build and Deploy name: "Build and Deploy"
on: on:
push: push:
branches: branches:
- 'master' - "master"
- 'main' - "main"
pull_request: pull_request:
branches: branches:
- 'master' - "master"
- 'main' - "main"
env: env:
IS_PUSH: ${{ github.event_name == 'push' }} IS_PUSH: ${{ github.event_name == 'push' }}
@ -16,21 +16,19 @@ env:
jobs: jobs:
build: build:
name: Build and Deploy name: "Build and Deploy"
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
# image: ubuntu:latest image: bvandevliet/runner-images:22-bookworm-slim
options: --volume "${{ secrets.NGINX_HTML_DIRECTORY }}:/usr/share/nginx/html:rw" options: --volume "/mnt/nginx-html:/usr/share/nginx/html:rw"
steps: steps:
- - name: "Checkout"
name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
# lfs: true # lfs: true
persist-credentials: true persist-credentials: true
- - # https://gitea.com/gitea/act_runner/issues/164#issuecomment-739652
# https://gitea.com/gitea/act_runner/issues/164#issuecomment-739652 name: "Checkout LFS"
name: Checkout LFS
run: | run: |
git lfs install git lfs install
AUTH=$(git config --get --local http.${{ github.server_url }}/.extraheader) AUTH=$(git config --get --local http.${{ github.server_url }}/.extraheader)
@ -38,8 +36,7 @@ jobs:
git config --local http.${{ github.server_url }}/batch.extraheader "$AUTH" git config --local http.${{ github.server_url }}/batch.extraheader "$AUTH"
git lfs fetch git lfs fetch
git lfs checkout git lfs checkout
- - name: "Get Metadata"
name: Get Metadata
id: meta id: meta
run: | run: |
branchName=${GITHUB_REF#refs/heads/} branchName=${GITHUB_REF#refs/heads/}
@ -58,27 +55,21 @@ jobs:
echo "VERSION=$version" >> $GITHUB_OUTPUT echo "VERSION=$version" >> $GITHUB_OUTPUT
echo "TAG_NAME=$tagName" >> $GITHUB_OUTPUT echo "TAG_NAME=$tagName" >> $GITHUB_OUTPUT
echo "PRERELEASE=$preRelease" >> $GITHUB_OUTPUT echo "PRERELEASE=$preRelease" >> $GITHUB_OUTPUT
- - name: "Setup pnpm"
name: Setup pnpm
uses: pnpm/action-setup@v4.0.0 uses: pnpm/action-setup@v4.0.0
- - name: "Install dependencies"
name: Install dependencies
run: pnpm install run: pnpm install
- - name: "Compile Sass and minify CSS and Javascript"
name: Compile Sass and minify CSS and Javascript
run: pnpm run build run: pnpm run build
- - name: "Append version query arg to asset URLs"
name: Append version query arg to asset URLs
env: env:
VERSION: ${{ steps.meta.outputs.VERSION }} VERSION: ${{ steps.meta.outputs.VERSION }}
run: | run: |
echo "VERSION = $VERSION" echo "VERSION = $VERSION"
find public -type f -name '*.html' -exec sed -i "s/\"\([^\"?]\+\.css\)\"/\"\1?v=$VERSION\"/g" {} + find public -type f -name '*.html' -exec sed -i "s/\"\([^\"?]\+\.css\)\"/\"\1?v=$VERSION\"/g" {} +
find public -type f -name '*.html' -exec sed -i "s/\"\([^\"?]\+\.js\)\"/\"\1?v=$VERSION\"/g" {} + find public -type f -name '*.html' -exec sed -i "s/\"\([^\"?]\+\.js\)\"/\"\1?v=$VERSION\"/g" {} +
- - name: "Minify HTML"
name: Minify HTML
run: | run: |
pnpm html-minifier-terser --collapse-whitespace --minify-css --minify-js --remove-comments --input-dir public --output-dir public --file-ext html pnpm html-minifier-terser --collapse-whitespace --minify-css --minify-js --remove-comments --input-dir public --output-dir public --file-ext html
- - name: "Copy files to public folder"
name: Copy files to public folder
run: mkdir -p /usr/share/nginx/html/fpv; cp -rf public/* /usr/share/nginx/html/fpv run: mkdir -p /usr/share/nginx/html/fpv; cp -rf public/* /usr/share/nginx/html/fpv