2022-04-25 11:06:01 +02:00
|
|
|
name: Container
|
|
|
|
|
|
|
|
on:
|
2022-11-18 21:55:17 +01:00
|
|
|
schedule:
|
|
|
|
- cron: '22 2 */6 * *' # every 6 days to avoid gha cache being evicted
|
2022-04-25 11:06:01 +02:00
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- '.devcontainer/**'
|
|
|
|
- 'examples/**'
|
|
|
|
- 'lib/**'
|
|
|
|
- 'man/**'
|
|
|
|
- 'priv/**'
|
|
|
|
- '**.md'
|
|
|
|
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
|
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
container:
|
|
|
|
name: Container
|
2024-02-01 17:02:14 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2022-04-25 11:06:01 +02:00
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
2023-09-11 08:16:03 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-04-25 11:06:01 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2024-05-30 20:51:54 +02:00
|
|
|
# - name: Cache build directory
|
|
|
|
# uses: actions/cache@v4
|
|
|
|
# with:
|
|
|
|
# path: ~/build/
|
|
|
|
# key: ${{runner.os}}-ctr-ct-ng-1.26.0
|
|
|
|
|
|
|
|
# - name: Get erlang/OTP version for bootstrapping
|
|
|
|
# run: |
|
|
|
|
# echo "OTP_VSN=$(awk '/^otp_vsn=/ {{gsub(/[^0-9.rc-]/, ""); print}}' tools/make-binaries)" >> $GITHUB_ENV
|
|
|
|
# echo "ELIXIR_VSN=$(awk '/^elixir_vsn=/ {{gsub(/[^0-9.]/, ""); print}}' tools/make-binaries)" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
# - name: Install prerequisites
|
|
|
|
# run: |
|
|
|
|
# sudo apt-get -qq update
|
|
|
|
# sudo apt-get -qq install makeself
|
|
|
|
# # https://github.com/crosstool-ng/crosstool-ng/blob/master/testing/docker/ubuntu21.10/Dockerfile
|
|
|
|
# sudo apt-get -qq install build-essential autoconf bison flex gawk
|
|
|
|
# sudo apt-get -qq install help2man libncurses5-dev libtool libtool-bin
|
|
|
|
# sudo apt-get -qq install python3-dev texinfo unzip
|
|
|
|
|
|
|
|
# - name: Install erlang/OTP
|
|
|
|
# uses: erlef/setup-beam@v1
|
|
|
|
# with:
|
|
|
|
# otp-version: ${{ env.OTP_VSN }}
|
|
|
|
# elixir-version: ${{ env.ELIXIR_VSN }}
|
|
|
|
# version-type: strict
|
|
|
|
|
|
|
|
# - name: Remove Elixir Matchers
|
|
|
|
# run: |
|
|
|
|
# echo "::remove-matcher owner=elixir-mixCompileWarning::"
|
|
|
|
# echo "::remove-matcher owner=elixir-credoOutputDefault::"
|
|
|
|
# echo "::remove-matcher owner=elixir-mixCompileError::"
|
|
|
|
# echo "::remove-matcher owner=elixir-mixTestFailure::"
|
|
|
|
# echo "::remove-matcher owner=elixir-dialyzerOutputDefault::"
|
|
|
|
|
|
|
|
# - name: Build musl-libc based binary archives
|
|
|
|
# run: |
|
|
|
|
# sed -i "s|targets='.*'|targets='x86_64-linux-musl aarch64-linux-musl'|" tools/make-binaries
|
|
|
|
# mv .github/container/ejabberdctl.template .
|
|
|
|
# CHECK_DEPS=false tools/make-binaries
|
|
|
|
|
|
|
|
# - name: Collect packages
|
|
|
|
# run: |
|
|
|
|
# mkdir tarballs
|
|
|
|
# mv ejabberd-*.tar.gz tarballs
|
2022-11-18 21:55:17 +01:00
|
|
|
|
2022-09-12 18:00:14 +02:00
|
|
|
- name: Checkout ejabberd-contrib
|
2023-09-11 08:16:03 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-09-12 18:00:14 +02:00
|
|
|
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
|
2023-09-18 08:37:41 +02:00
|
|
|
uses: docker/login-action@v3
|
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
|
2023-09-18 08:37:44 +02:00
|
|
|
uses: docker/metadata-action@v5
|
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
|
2023-09-18 08:37:47 +02:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-04-25 11:06:01 +02:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
2023-09-18 08:37:50 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-04-25 11:06:01 +02:00
|
|
|
|
|
|
|
- name: Build and push Docker image
|
2024-06-27 15:07:48 +02:00
|
|
|
uses: docker/build-push-action@v6
|
2022-04-25 11:06:01 +02:00
|
|
|
with:
|
|
|
|
build-args: |
|
2024-05-30 20:51:54 +02:00
|
|
|
METHOD=direct
|
2022-04-25 11:06:01 +02:00
|
|
|
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 }}
|
2024-05-30 20:51:54 +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 }}
|