mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 01:39:35 +02:00
Merge 8e5b86e6e8
into 060992bafa
This commit is contained in:
commit
0f51075ebc
1 changed files with 105 additions and 6 deletions
111
.github/workflows/container.yml
vendored
111
.github/workflows/container.yml
vendored
|
@ -15,9 +15,15 @@ env:
|
|||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
container:
|
||||
|
||||
build-amd64:
|
||||
name: Container
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04${{ matrix.runner-suffix }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- platform: amd64
|
||||
runner-suffix:
|
||||
permissions:
|
||||
packages: write
|
||||
steps:
|
||||
|
@ -48,14 +54,12 @@ jobs:
|
|||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
flavor: suffix=--${{ matrix.platform }},latest=false
|
||||
labels: |
|
||||
org.opencontainers.image.revision=${{ steps.gitdescribe.outputs.ver }}
|
||||
org.opencontainers.image.licenses=GPL-2.0
|
||||
org.opencontainers.image.vendor=ProcessOne
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
|
@ -69,6 +73,101 @@ jobs:
|
|||
context: .
|
||||
file: .github/container/Dockerfile
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/${{ matrix.platform }}
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
build-arm64:
|
||||
name: Container
|
||||
runs-on: ubuntu-24.04${{ matrix.runner-suffix }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- platform: arm64
|
||||
runner-suffix: -arm
|
||||
permissions:
|
||||
packages: write
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Checkout ejabberd-contrib
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: processone/ejabberd-contrib
|
||||
path: .ejabberd-modules/sources/ejabberd-contrib
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Get git describe
|
||||
id: gitdescribe
|
||||
run: echo "ver=$(git describe --tags)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
flavor: suffix=--${{ matrix.platform }},latest=false
|
||||
labels: |
|
||||
org.opencontainers.image.revision=${{ steps.gitdescribe.outputs.ver }}
|
||||
org.opencontainers.image.licenses=GPL-2.0
|
||||
org.opencontainers.image.vendor=ProcessOne
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
build-args: |
|
||||
VERSION=${{ steps.gitdescribe.outputs.ver }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
context: .
|
||||
file: .github/container/Dockerfile
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: linux/${{ matrix.platform }}
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
merge:
|
||||
needs:
|
||||
- build-amd64
|
||||
- build-arm64
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
image-uri: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.merge.outputs.digest }}
|
||||
steps:
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: docker/metadata-action@v5
|
||||
id: metadata
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
- uses: int128/docker-manifest-create-action@v2
|
||||
id: merge
|
||||
with:
|
||||
index-annotations: ${{ steps.metadata.outputs.labels }}
|
||||
tags: ${{ steps.metadata.outputs.tags }}
|
||||
sources: |
|
||||
${{ steps.metadata.outputs.tags }}--amd64
|
||||
${{ steps.metadata.outputs.tags }}--arm64
|
||||
- uses: dataaxiom/ghcr-cleanup-action@v1
|
||||
with:
|
||||
dry-run: true
|
||||
delete-tags: '*--a??64'
|
||||
delete-untagged: true
|
||||
delete-ghost-images: true
|
||||
delete-partial-images: true
|
||||
delete-orphaned-images: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue