66 lines
1.6 KiB
YAML
66 lines
1.6 KiB
YAML
---
|
|
name: Docker images build and push
|
|
|
|
#on:
|
|
# push:
|
|
# branches:
|
|
# - 'develop'
|
|
# paths:
|
|
# - util/dockerfiles/**
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
|
|
jobs:
|
|
|
|
obtain-targets:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
targets: ${{ steps.generate.outputs.targets }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: List targets
|
|
id: generate
|
|
uses: docker/bake-action/subaction/list-targets@v4
|
|
with:
|
|
target: default
|
|
workdir: util/dockerfiles
|
|
|
|
docker-buildx-bake:
|
|
runs-on: [self-hosted, linux, x64]
|
|
needs:
|
|
- obtain-targets
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target: ${{ fromJson(needs.obtain-targets.outputs.targets) }}
|
|
|
|
permissions:
|
|
packages: write
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/bake-action@v5
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
workdir: util/dockerfiles
|
|
push: true
|