mirror of
https://github.com/chaifeng/ufw-docker.git
synced 2025-07-07 02:56:13 +02:00
51 lines
1.5 KiB
YAML
51 lines
1.5 KiB
YAML
name: Build Images
|
|
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
arch: [amd64, arm64/v8]
|
|
variant:
|
|
- name: nf_tables
|
|
use_iptables_legacy: "false"
|
|
- name: legacy
|
|
use_iptables_legacy: "true"
|
|
steps:
|
|
- name: Log into DockerHub
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ github.actor }}/ufw-docker-agent
|
|
tags: |
|
|
type=schedule,suffix=${{ matrix.variant.name }}
|
|
type=ref,event=branch,suffix=${{ matrix.variant.name }}
|
|
type=ref,event=pr,suffix=${{ matrix.variant.name }}
|
|
type=semver,pattern={{version}},suffix=${{ matrix.variant.name }}
|
|
type=sha,suffix=${{ matrix.variant.name }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
platforms: linux/${{ matrix.arch }}
|
|
build-args: |
|
|
use_iptables_legacy=${{ matrix.variant.use_iptables_legacy }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|