2022-04-25 11:06:01 +02:00
|
|
|
name: Container
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- '.devcontainer/**'
|
|
|
|
- 'examples/**'
|
|
|
|
- 'lib/**'
|
|
|
|
- 'man/**'
|
|
|
|
- 'priv/**'
|
|
|
|
- '**.md'
|
|
|
|
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
|
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
container:
|
|
|
|
name: Container
|
2022-09-02 11:28:02 +02:00
|
|
|
runs-on: ubuntu-latest
|
2022-04-25 11:06:01 +02:00
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2022-09-12 18:00:14 +02:00
|
|
|
- name: Checkout ejabberd-contrib
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: processone/ejabberd-contrib
|
|
|
|
path: .ejabberd-modules/sources/ejabberd-contrib
|
|
|
|
|
2022-04-25 11:06:01 +02:00
|
|
|
- name: Log in to the Container registry
|
2022-12-20 12:25:12 +01:00
|
|
|
uses: docker/login-action@v2
|
2022-04-25 11:06:01 +02:00
|
|
|
with:
|
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Get git describe
|
|
|
|
id: gitdescribe
|
2023-01-16 13:46:51 +01:00
|
|
|
run: echo "ver=$(git describe --tags)" >> $GITHUB_OUTPUT
|
2022-04-25 11:06:01 +02:00
|
|
|
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
|
|
id: meta
|
2022-12-20 12:25:12 +01:00
|
|
|
uses: docker/metadata-action@v4
|
2022-04-25 11:06:01 +02:00
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
|
|
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
|
2022-12-20 12:25:12 +01:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-04-25 11:06:01 +02:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2022-12-20 12:25:12 +01:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-04-25 11:06:01 +02:00
|
|
|
|
|
|
|
- name: Build and push Docker image
|
2023-02-06 07:16:08 +01:00
|
|
|
uses: docker/build-push-action@v4
|
2022-04-25 11:06:01 +02:00
|
|
|
with:
|
|
|
|
build-args: |
|
|
|
|
VERSION=${{ steps.gitdescribe.outputs.ver }}
|
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|
2022-09-06 19:59:33 +02:00
|
|
|
context: .
|
|
|
|
file: .github/container/Dockerfile
|
2022-04-25 11:06:01 +02:00
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2022-05-04 12:39:59 +02:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-04-25 11:06:01 +02:00
|
|
|
push: true
|
2022-05-06 17:58:58 +02:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|