This commit is contained in:
Christoph
2026-12-03 18:48:02 +01:00
parent d5a74a10ac
commit 141eb838bb
7 changed files with 25 additions and 77 deletions
+13 -34
View File
@@ -14,7 +14,14 @@ permissions:
jobs:
build-n-push:
name: Build and Push
name: Build and Push (${{ matrix.target }})
strategy:
matrix:
include:
- target: standard
suffix: ''
- target: amneziawg
suffix: '-amneziawg,onlatest=true'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
@@ -55,7 +62,7 @@ jobs:
flavor: |
latest=auto
prefix=
suffix=
suffix=${{ matrix.suffix }}
tags: |
type=ref,event=tag
type=ref,event=branch
@@ -71,6 +78,7 @@ jobs:
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
target: ${{ matrix.target }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
@@ -80,6 +88,7 @@ jobs:
BUILD_VERSION=${{ env.BUILD_VERSION }}
- name: Export binaries from images
if: matrix.target == 'standard'
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
@@ -89,45 +98,15 @@ jobs:
build-args: |
BUILD_VERSION=${{ env.BUILD_VERSION }}
- name: Extract metadata for AmneziaWG image
id: meta-awg
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: |
wgportal/wg-portal
ghcr.io/${{ github.repository }}
flavor: |
latest=auto
suffix=-amneziawg,onlatest=true
tags: |
type=ref,event=tag
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
- name: Build and push AmneziaWG Docker image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
target: amneziawg
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-awg.outputs.tags }}
labels: ${{ steps.meta-awg.outputs.labels }}
annotations: ${{ steps.meta-awg.outputs.annotations }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
build-args: |
BUILD_VERSION=${{ env.BUILD_VERSION }}
- name: Rename binaries
if: matrix.target == 'standard'
run: |
for file in binaries/linux*/wg-portal; do
mv $file binaries/wg-portal_$(basename $(dirname $file))
done
- name: Upload binaries
if: matrix.target == 'standard'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: binaries