mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 12:52:54 -05:00
speed up docker build github actions
Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
This commit is contained in:
33
.github/workflows/docker.yml
vendored
33
.github/workflows/docker.yml
vendored
@@ -1,4 +1,5 @@
|
||||
name: Docker-Builder
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -11,7 +12,9 @@ env:
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
|
||||
check-token:
|
||||
name: Check Token
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
token_defined: ${{ steps.token_check.outputs.token_defined }}
|
||||
@@ -22,16 +25,20 @@ jobs:
|
||||
MY_TOKEN: ${{ secrets.MY_TOKEN }}
|
||||
if: "${{ env.MY_TOKEN != '' }}"
|
||||
run: echo "token_defined=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build:
|
||||
name: Release
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-token]
|
||||
if: needs.check-token.outputs.token_defined == 'true'
|
||||
steps:
|
||||
- name: Checkout
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
node-version: 'lts/*'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
@@ -54,6 +61,22 @@ jobs:
|
||||
env:
|
||||
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
||||
|
||||
- name: Install Translate Packages (allowed to fail)
|
||||
working-directory: ./translate
|
||||
run: node translate.js || true
|
||||
|
||||
- name: Run extractall
|
||||
working-directory: ./translate
|
||||
run: node translate.js extractall
|
||||
|
||||
- name: Run minifyall
|
||||
working-directory: ./translate
|
||||
run: node translate.js minifyall
|
||||
|
||||
- name: Run translateall
|
||||
working-directory: ./translate
|
||||
run: node translate.js translateall
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
@@ -68,8 +91,8 @@ jobs:
|
||||
INCLUDE_MONGODB_TOOLS=true
|
||||
INCLUDE_POSTGRESQL_TOOLS=true
|
||||
INCLUDE_MARIADB_TOOLS=true
|
||||
DISABLE_MINIFY=no
|
||||
DISABLE_TRANSLATE=no
|
||||
DISABLE_MINIFY=yes
|
||||
DISABLE_TRANSLATE=yes
|
||||
PREINSTALL_LIBS=true
|
||||
|
||||
#- name: Docker Scout
|
||||
|
||||
@@ -33,7 +33,7 @@ RUN if [ -n "$DISABLE_MINIFY" ] || [ -n "$DISABLE_TRANSLATE" ]; then \
|
||||
*) \
|
||||
echo "Setting TRANSLATE as disabled.";; \
|
||||
esac; \
|
||||
npm uninstall html-minifier jsdom esprima; \
|
||||
npm uninstall html-minifier-terser jsdom esprima; \
|
||||
fi
|
||||
# Possible more updated alternative? @minify-html/node@0.15.0 -> https://www.npmjs.com/package/@minify-html/node
|
||||
|
||||
|
||||
Reference in New Issue
Block a user