mirror of
https://github.com/chaifeng/ufw-docker.git
synced 2025-07-11 03:36:14 +02:00
Multi-platform builds
This commit is contained in:
parent
c0e54ed8b2
commit
2070bcdc98
1 changed files with 17 additions and 5 deletions
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
|
@ -1,47 +1,59 @@
|
||||||
name: Build Images
|
name: Build and Push Images
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
arch: [amd64, arm64/v8]
|
|
||||||
variant:
|
variant:
|
||||||
- name: nf_tables
|
- name: nf_tables
|
||||||
use_iptables_legacy: "false"
|
use_iptables_legacy: "false"
|
||||||
- name: legacy
|
- name: legacy
|
||||||
use_iptables_legacy: "true"
|
use_iptables_legacy: "true"
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Log into DockerHub
|
- name: Log into DockerHub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ github.actor }}/ufw-docker-agent
|
images: ${{ github.repository }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=tag,suffix=-${{ matrix.variant.name }}
|
type=ref,event=tag,suffix=-${{ matrix.variant.name }}
|
||||||
|
type=ref,event=branch,suffix=-${{ matrix.variant.name }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
|
context: .
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
platforms: linux/${{ matrix.arch }}
|
platforms: linux/amd64,linux/arm64/v8
|
||||||
build-args: |
|
build-args: |
|
||||||
use_iptables_legacy=${{ matrix.variant.use_iptables_legacy }}
|
use_iptables_legacy=${{ matrix.variant.use_iptables_legacy }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue