mirror of
https://github.com/nicolargo/glances.git
synced 2026-04-19 21:40:33 -04:00
Bumps the actions group with 10 updates: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `5.0.1` | `6.0.2` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.6.2` | `7.0.0` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `5.0.0` | `8.0.1` | | [docker/metadata-action](https://github.com/docker/metadata-action) | `5.10.0` | `6.0.0` | | [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `3.7.0` | `4.0.0` | | [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.12.0` | `4.0.0` | | [docker/login-action](https://github.com/docker/login-action) | `3.7.0` | `4.0.0` | | [docker/build-push-action](https://github.com/docker/build-push-action) | `6.19.2` | `7.0.0` | | [github/codeql-action](https://github.com/github/codeql-action) | `3.32.6` | `4.32.6` | | [actions/setup-node](https://github.com/actions/setup-node) | `5.0.0` | `6.3.0` | Updates `actions/checkout` from 5.0.1 to 6.0.2 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](93cb6efe18...de0fac2e45) Updates `actions/upload-artifact` from 4.6.2 to 7.0.0 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](ea165f8d65...bbbca2ddaa) Updates `actions/download-artifact` from 5.0.0 to 8.0.1 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](634f93cb29...3e5f45b2cf) Updates `docker/metadata-action` from 5.10.0 to 6.0.0 - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](c299e40c65...030e881283) Updates `docker/setup-qemu-action` from 3.7.0 to 4.0.0 - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](c7c5346462...ce360397dd) Updates `docker/setup-buildx-action` from 3.12.0 to 4.0.0 - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](8d2750c68a...4d04d5d948) Updates `docker/login-action` from 3.7.0 to 4.0.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](c94ce9fb46...b45d80f862) Updates `docker/build-push-action` from 6.19.2 to 7.0.0 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](10e90e3645...d08e5c354a) Updates `github/codeql-action` from 3.32.6 to 4.32.6 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](820e3160e2...0d579ffd05) Updates `actions/setup-node` from 5.0.0 to 6.3.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](a0853c2454...53b83947a5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.2 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/upload-artifact dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/download-artifact dependency-version: 8.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/metadata-action dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/setup-qemu-action dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/setup-buildx-action dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/login-action dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: docker/build-push-action dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: github/codeql-action dependency-version: 4.32.6 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-node dependency-version: 6.3.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
112 lines
4.1 KiB
YAML
112 lines
4.1 KiB
YAML
# This pipeline aims at building Glances Docker images
|
|
|
|
name: build_docker
|
|
|
|
env:
|
|
DEFAULT_DOCKER_IMAGE: nicolargo/glances
|
|
PUSH_BRANCH: ${{ 'refs/heads/develop' == github.ref || startsWith(github.ref, 'refs/tags/v') }}
|
|
# Alpine image platform: https://hub.docker.com/_/alpine
|
|
# linux/arm/v6,linux/arm/v7 do not work (timeout during the build)
|
|
DOCKER_PLATFORMS: linux/amd64,linux/arm64/v8
|
|
# Ubuntu image platforms list: https://hub.docker.com/_/ubuntu
|
|
# linux/arm/v7 do not work (Cargo/Rust not available)
|
|
DOCKER_PLATFORMS_UBUNTU: linux/amd64,linux/arm64/v8
|
|
|
|
on:
|
|
workflow_call:
|
|
secrets:
|
|
DOCKER_USERNAME:
|
|
description: 'Docker Hub username'
|
|
required: true
|
|
DOCKER_TOKEN:
|
|
description: 'Docker Hub token'
|
|
required: true
|
|
|
|
jobs:
|
|
|
|
create_docker_images_list:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
permissions: {}
|
|
outputs:
|
|
tags: ${{ steps.config.outputs.tags }}
|
|
steps:
|
|
- name: Determine image tags
|
|
id: config
|
|
shell: bash
|
|
run: |
|
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
VERSION=${GITHUB_REF#refs/tags/v}
|
|
TAG_ARRAY="[{ \"target\": \"minimal\", \"tag\": \"${VERSION}\" },"
|
|
TAG_ARRAY="$TAG_ARRAY { \"target\": \"minimal\", \"tag\": \"latest\" },"
|
|
TAG_ARRAY="$TAG_ARRAY { \"target\": \"full\", \"tag\": \"${VERSION}-full\" },"
|
|
TAG_ARRAY="$TAG_ARRAY { \"target\": \"full\", \"tag\": \"latest-full\" }]"
|
|
elif [[ $GITHUB_REF == refs/heads/develop ]]; then
|
|
TAG_ARRAY="[{ \"target\": \"dev\", \"tag\": \"dev\" }]"
|
|
else
|
|
TAG_ARRAY="[]"
|
|
fi
|
|
|
|
echo "Tags to build: $TAG_ARRAY"
|
|
echo "tags=$TAG_ARRAY" >> $GITHUB_OUTPUT
|
|
|
|
build_docker_images:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
permissions:
|
|
contents: read
|
|
needs:
|
|
- create_docker_images_list
|
|
if: needs.create_docker_images_list.outputs.tags != '[]'
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ['alpine', 'ubuntu']
|
|
tag: ${{ fromJson(needs.create_docker_images_list.outputs.tags) }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Retrieve Repository Docker metadata
|
|
id: docker_meta
|
|
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
|
with:
|
|
images: ${{ env.DEFAULT_DOCKER_IMAGE }}
|
|
labels: |
|
|
org.opencontainers.image.url=https://nicolargo.github.io/glances/
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
|
with:
|
|
platforms: all
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
|
with:
|
|
version: latest
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
|
|
if: ${{ env.PUSH_BRANCH == 'true' }}
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
- name: Build and push image
|
|
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
|
|
with:
|
|
push: ${{ env.PUSH_BRANCH == 'true' }}
|
|
tags: "${{ env.DEFAULT_DOCKER_IMAGE }}:${{ matrix.os != 'alpine' && format('{0}-', matrix.os) || '' }}${{ matrix.tag.tag }}"
|
|
build-args: |
|
|
CHANGING_ARG=${{ github.sha }}
|
|
context: .
|
|
file: "docker-files/${{ matrix.os }}.Dockerfile"
|
|
platforms: ${{ matrix.os != 'ubuntu' && env.DOCKER_PLATFORMS || env.DOCKER_PLATFORMS_UBUNTU }}
|
|
target: ${{ matrix.tag.target }}
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
|
# GHA default behaviour overwrites last build cache. Causes alpine and ubuntu cache to overwrite each other.
|
|
# Use `scope` with the os name to prevent that
|
|
cache-from: 'type=gha,scope=${{ matrix.os }}'
|
|
cache-to: 'type=gha,mode=max,scope=${{ matrix.os }}'
|