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

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

View file

@ -1,14 +1,14 @@
name: Build and Deploy
name: "Build and Deploy"
on:
push:
branches:
- 'master'
- 'main'
- "master"
- "main"
pull_request:
branches:
- 'master'
- 'main'
- "master"
- "main"
env:
IS_PUSH: ${{ github.event_name == 'push' }}
@ -16,21 +16,19 @@ env:
jobs:
build:
name: Build and Deploy
name: "Build and Deploy"
runs-on: ubuntu-latest
container:
# image: ubuntu:latest
options: --volume "${{ secrets.NGINX_HTML_DIRECTORY }}:/usr/share/nginx/html:rw"
image: bvandevliet/runner-images:24-trixie-slim
options: --volume "/mnt/nginx-html:/usr/share/nginx/html:rw"
steps:
-
name: Checkout
- name: "Checkout"
uses: actions/checkout@v4
with:
# lfs: true
persist-credentials: true
-
# https://gitea.com/gitea/act_runner/issues/164#issuecomment-739652
name: Checkout LFS
- # https://gitea.com/gitea/act_runner/issues/164#issuecomment-739652
name: "Checkout LFS"
run: |
git lfs install
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 lfs fetch
git lfs checkout
-
name: Get Metadata
- name: "Get Metadata"
id: meta
run: |
branchName=${GITHUB_REF#refs/heads/}
@ -58,27 +55,23 @@ jobs:
echo "VERSION=$version" >> $GITHUB_OUTPUT
echo "TAG_NAME=$tagName" >> $GITHUB_OUTPUT
echo "PRERELEASE=$preRelease" >> $GITHUB_OUTPUT
-
name: Setup pnpm
- name: "Setup pnpm"
uses: pnpm/action-setup@v4.0.0
-
name: Install dependencies
- name: "Install dependencies"
run: pnpm install
-
name: Compile Sass and minify CSS and Javascript
- name: "Compile Sass and minify CSS and Javascript"
run: pnpm run build
-
name: Append version query arg to asset URLs
- name: "Append version query arg to asset URLs"
env:
VERSION: ${{ steps.meta.outputs.VERSION }}
run: |
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/\"\([^\"?]\+\.js\)\"/\"\1?v=$VERSION\"/g" {} +
-
name: Minify HTML
run: |
- name: "Minify HTML"
run: >
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
run: mkdir -p /usr/share/nginx/html/fpv; cp -rf public/* /usr/share/nginx/html/fpv
- name: "Copy files to public folder"
run: |
mkdir -p /usr/share/nginx/html/fpv
cp -rf public/* /usr/share/nginx/html/fpv