build-push-action@v6 #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build amd64 image with stable repository (no armhf) | |
on: | |
workflow_dispatch: | |
push: | |
branches: "master" | |
env: | |
IMAGE: ntopng | |
jobs: | |
build: | |
continue-on-error: true | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
#No stable for armhf | |
tag: [ latest ] | |
env: | |
TAG: ${{ matrix.tag }} | |
DEBIAN_VER: bullseye | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: latest | |
install: true | |
use: true | |
- name: Available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: Builder instance name | |
run: echo ${{ steps.buildx.outputs.name }} | |
- name: Cache Docker layers | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Login to Docker hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push | |
if: github.event_name != 'pull_request' | |
uses: docker/build-push-action@v6 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
file: ./Dockerfile.all | |
build-args: | | |
TZ: Europe/Paris | |
TAG: ${{ matrix.TAG }} | |
DEBIAN_VER: ${{ env.DEBIAN_VER }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
#no stable for armhf | |
platforms: linux/amd64 | |
push: true | |
tags: ${{ secrets.DOCKER_USER }}/${{ env.IMAGE }}:${{ env.TAG }} | |
- name: clean | |
if: always() && github.event_name != 'pull_request' | |
run: | | |
rm -f ${HOME}/.docker/config.json |