mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-07-26 08:50:06 -04:00
106 lines
2.8 KiB
YAML
106 lines
2.8 KiB
YAML
name: Docker-Builder
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
release:
|
|
types: [ published ]
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
|
|
|
check-token:
|
|
name: Check Token
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
token_defined: ${{ steps.token_check.outputs.token_defined }}
|
|
steps:
|
|
- name: Check token
|
|
id: token_check
|
|
env:
|
|
MY_TOKEN: ${{ secrets.MY_TOKEN }}
|
|
if: "${{ env.MY_TOKEN != '' }}"
|
|
run: echo "token_defined=true" >> "$GITHUB_OUTPUT"
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
needs: [check-token]
|
|
if: needs.check-token.outputs.token_defined == 'true'
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 'lts/*'
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.MY_TOKEN }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
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:
|
|
context: .
|
|
file: docker/Dockerfile
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
annotations: ${{ steps.meta.outputs.annotations }}
|
|
build-args: |
|
|
INCLUDE_MONGODB_TOOLS=true
|
|
INCLUDE_POSTGRESQL_TOOLS=true
|
|
INCLUDE_MARIADB_TOOLS=true
|
|
DISABLE_MINIFY=yes
|
|
DISABLE_TRANSLATE=yes
|
|
PREINSTALL_LIBS=true
|
|
|
|
#- name: Docker Scout
|
|
# id: docker-scout
|
|
# uses: docker/scout-action@v1
|
|
# with:
|
|
# command: quickview,cves
|
|
# image: image://
|
|
# summary: true
|
|
# only-severities: critical,high,medium,low,unspecified
|