mirror of
https://github.com/3proxy/3proxy.git
synced 2025-06-08 12:34:48 +08:00

Workflow for building docker images on multiple platforms (x64, arm64 and arm) Fix .gitignore because of missing files during workflow
98 lines
2.8 KiB
YAML
98 lines
2.8 KiB
YAML
---
|
|
name: Dispatch Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
branch-tag:
|
|
description: 'Branch/Tag to Checkout'
|
|
required: false
|
|
default: 'master'
|
|
platforms:
|
|
description: 'Set the platforms to build [ linux/amd64, linux/arm64, linux/arm/v7 or linux/arm/v6]'
|
|
required: false
|
|
default: 'linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
IMAGE: victorrds/3proxy
|
|
LABELS: |
|
|
maintainer=${{ github.actor }}
|
|
org.opencontainers.image.authors='Vladimir \'3APA3A\' Dubrovin <3proxy@3proxy.org>;Victor R. Santos <victor-rds@users.noreply.github.com>'
|
|
QEMU_PLAT: amd64,arm64,arm
|
|
META_TAGS: |
|
|
type=sha
|
|
type=pep440,pattern={{version}}
|
|
type=pep440,pattern={{major}}.{{minor}}
|
|
type=pep440,pattern={{major}}
|
|
|
|
steps:
|
|
- name: Checkout Dockerfiles and Context
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ github.event.inputs.branch-tag }}
|
|
|
|
- id: metadata_full
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
labels: ${{ env.LABELS }}
|
|
images: |
|
|
${{ env.IMAGE }}
|
|
flavor: |
|
|
latest=true
|
|
tags: |
|
|
${{ env.META_TAGS }}
|
|
type=raw,suffix=,value=full
|
|
|
|
- id: metadata_minimal
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
labels: ${{ env.LABELS }}
|
|
images: |
|
|
${{ env.IMAGE }}
|
|
flavor: |
|
|
suffix=-minimal
|
|
tags: |
|
|
${{ env.META_TAGS }}
|
|
type=raw,suffix=,value=minimal
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
with:
|
|
platforms: ${{ env.QEMU_PLAT }}
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
- name: Build and Push Minimal
|
|
id: build_push_minimal
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
platforms: ${{ github.event.inputs.platforms }}
|
|
file: ./Dockerfile.minimal
|
|
tags: ${{ steps.metadata_minimal.outputs.tags }}
|
|
labels: ${{ steps.metadata_minimal.outputs.labels }}
|
|
push: true
|
|
|
|
- name: Build and Push Full
|
|
id: build_push_full
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
platforms: ${{ github.event.inputs.platforms }}
|
|
file: ./Dockerfile.full
|
|
tags: ${{ steps.metadata_full.outputs.tags }}
|
|
labels: ${{ steps.metadata_full.outputs.labels }}
|
|
push: true
|