mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 20:47:01 +01:00
2856 - use tags for containers on build (#3139)
* ci: push docker image for git tags * tweaking tag references, such tag, many build --------- Co-authored-by: guillaumedsde <30023543+guillaumedsde@users.noreply.github.com>
This commit is contained in:
parent
ccb3848b88
commit
120f990ce1
19
.github/workflows/docker_build_kanidm.yml
vendored
19
.github/workflows/docker_build_kanidm.yml
vendored
|
@ -12,22 +12,28 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
set_lower_case_name:
|
set_tag_values:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: set lower case owner name
|
name: Set image tag values
|
||||||
steps:
|
steps:
|
||||||
- id: step1
|
- id: step1
|
||||||
run: |
|
run: |
|
||||||
echo "OWNER_LC=${OWNER,,}" >> "${GITHUB_OUTPUT}"
|
echo "OWNER_LC=${OWNER,,}" >> "${GITHUB_OUTPUT}"
|
||||||
env:
|
env:
|
||||||
OWNER: '${{ github.repository_owner }}'
|
OWNER: '${{ github.repository_owner }}'
|
||||||
|
- id: step2
|
||||||
|
run: |
|
||||||
|
echo "REF_NAME=$(echo ${REF_NAME,,} | awk -F/ '{print $1}')" >> "${GITHUB_OUTPUT}"
|
||||||
|
env:
|
||||||
|
REF_NAME: '${{ github.ref_name }}'
|
||||||
outputs:
|
outputs:
|
||||||
owner_lc: ${{ steps.step1.outputs.OWNER_LC }}
|
owner_lc: ${{ steps.step1.outputs.OWNER_LC }}
|
||||||
|
ref_name: ${{ steps.step2.outputs.REF_NAME }}
|
||||||
kanidm_build:
|
kanidm_build:
|
||||||
name: Build kanidm Docker image
|
name: Build kanidm Docker image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: set_lower_case_name
|
needs:
|
||||||
|
- set_tag_values
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
|
@ -36,11 +42,10 @@ jobs:
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
platforms: "linux/amd64"
|
platforms: "linux/amd64"
|
||||||
tags: ghcr.io/${{ needs.set_lower_case_name.outputs.owner_lc }}/kanidm:devel
|
tags: ghcr.io/${{ needs.set_tag_values.outputs.owner_lc }}/kanidm:devel,ghcr.io/${{ needs.set_tag_values.outputs.owner_lc }}/kanidm:${{ needs.set_tag_values.outputs.ref_name}}
|
||||||
|
|
||||||
build-args: |
|
build-args: |
|
||||||
"KANIDM_FEATURES="
|
"KANIDM_FEATURES="
|
||||||
# "KANIDM_BUILD_OPTIONS=-j1"
|
|
||||||
file: tools/Dockerfile
|
file: tools/Dockerfile
|
||||||
# Must use OCI exporter for multi-arch: https://github.com/docker/buildx/pull/1813
|
# Must use OCI exporter for multi-arch: https://github.com/docker/buildx/pull/1813
|
||||||
outputs: type=oci,dest=/tmp/kanidm-docker.tar
|
outputs: type=oci,dest=/tmp/kanidm-docker.tar
|
||||||
|
@ -55,7 +60,7 @@ jobs:
|
||||||
# This step is split so that we don't apply "packages: write" permission
|
# This step is split so that we don't apply "packages: write" permission
|
||||||
# except when uploading the final Docker image to GHCR.
|
# except when uploading the final Docker image to GHCR.
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.ref == 'refs/heads/master' && github.repository == 'kanidm/kanidm'
|
if: ( github.ref_type == 'tag' || github.ref == 'refs/heads/master' ) && github.repository == 'kanidm/kanidm'
|
||||||
needs: kanidm_build
|
needs: kanidm_build
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
|
|
16
.github/workflows/docker_build_kanidmd.yml
vendored
16
.github/workflows/docker_build_kanidmd.yml
vendored
|
@ -12,22 +12,28 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
set_lower_case_name:
|
set_tag_values:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: set lower case owner name
|
name: Set image tag values
|
||||||
steps:
|
steps:
|
||||||
- id: step1
|
- id: step1
|
||||||
run: |
|
run: |
|
||||||
echo "OWNER_LC=${OWNER,,}" >> "${GITHUB_OUTPUT}"
|
echo "OWNER_LC=${OWNER,,}" >> "${GITHUB_OUTPUT}"
|
||||||
env:
|
env:
|
||||||
OWNER: '${{ github.repository_owner }}'
|
OWNER: '${{ github.repository_owner }}'
|
||||||
|
- id: step2
|
||||||
|
run: |
|
||||||
|
echo "REF_NAME=$(echo ${REF_NAME,,} | awk -F/ '{print $1}')" >> "${GITHUB_OUTPUT}"
|
||||||
|
env:
|
||||||
|
REF_NAME: '${{ github.ref_name }}'
|
||||||
outputs:
|
outputs:
|
||||||
owner_lc: ${{ steps.step1.outputs.OWNER_LC }}
|
owner_lc: ${{ steps.step1.outputs.OWNER_LC }}
|
||||||
|
ref_name: ${{ steps.step2.outputs.REF_NAME }}
|
||||||
|
|
||||||
kanidmd_build:
|
kanidmd_build:
|
||||||
name: Build kanidmd Docker image
|
name: Build kanidmd Docker image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: set_lower_case_name
|
needs: set_tag_values
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
|
@ -54,7 +60,7 @@ jobs:
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
platforms: "linux/amd64"
|
platforms: "linux/amd64"
|
||||||
tags: ghcr.io/${{ needs.set_lower_case_name.outputs.owner_lc }}/kanidmd:devel
|
tags: ghcr.io/${{ needs.set_tag_values.outputs.owner_lc }}/kanidmd:devel,ghcr.io/${{ needs.set_tag_values.outputs.owner_lc }}/kanidmd:${{ needs.set_tag_values.outputs.ref_name}}
|
||||||
# build-args: |
|
# build-args: |
|
||||||
# "KANIDM_BUILD_OPTIONS=-j1"
|
# "KANIDM_BUILD_OPTIONS=-j1"
|
||||||
file: server/Dockerfile
|
file: server/Dockerfile
|
||||||
|
@ -71,7 +77,7 @@ jobs:
|
||||||
# This step is split so that we don't apply "packages: write" permission
|
# This step is split so that we don't apply "packages: write" permission
|
||||||
# except when uploading the final Docker image to GHCR.
|
# except when uploading the final Docker image to GHCR.
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.ref == 'refs/heads/master' && github.repository == 'kanidm/kanidm'
|
if: ( github.ref_type== 'tag' || github.ref == 'refs/heads/master' ) && github.repository == 'kanidm/kanidm'
|
||||||
needs: kanidmd_build
|
needs: kanidmd_build
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
|
|
16
.github/workflows/docker_build_radiusd.yml
vendored
16
.github/workflows/docker_build_radiusd.yml
vendored
|
@ -12,22 +12,28 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
set_lower_case_name:
|
set_tag_values:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: set lower case owner name
|
name: Set image tag values
|
||||||
steps:
|
steps:
|
||||||
- id: step1
|
- id: step1
|
||||||
run: |
|
run: |
|
||||||
echo "OWNER_LC=${OWNER,,}" >> "${GITHUB_OUTPUT}"
|
echo "OWNER_LC=${OWNER,,}" >> "${GITHUB_OUTPUT}"
|
||||||
env:
|
env:
|
||||||
OWNER: '${{ github.repository_owner }}'
|
OWNER: '${{ github.repository_owner }}'
|
||||||
|
- id: step2
|
||||||
|
run: |
|
||||||
|
echo "REF_NAME=$(echo ${REF_NAME,,} | awk -F/ '{print $1}')" >> "${GITHUB_OUTPUT}"
|
||||||
|
env:
|
||||||
|
REF_NAME: '${{ github.ref_name }}'
|
||||||
outputs:
|
outputs:
|
||||||
owner_lc: ${{ steps.step1.outputs.OWNER_LC }}
|
owner_lc: ${{ steps.step1.outputs.OWNER_LC }}
|
||||||
|
ref_name: ${{ steps.step2.outputs.REF_NAME }}
|
||||||
|
|
||||||
radius_build:
|
radius_build:
|
||||||
name: Build radius Docker image
|
name: Build radius Docker image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: set_lower_case_name
|
needs: set_tag_values
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
|
@ -38,7 +44,7 @@ jobs:
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
platforms: linux/arm64,linux/amd64
|
platforms: linux/arm64,linux/amd64
|
||||||
tags: ghcr.io/${{ needs.set_lower_case_name.outputs.owner_lc }}/radius:devel
|
tags: ghcr.io/${{ needs.set_tag_values.outputs.owner_lc }}/radius:devel,ghcr.io/${{ needs.set_tag_values.outputs.owner_lc }}/radius:${{ needs.set_tag_values.outputs.ref_name}}
|
||||||
file: rlm_python/Dockerfile
|
file: rlm_python/Dockerfile
|
||||||
# Must use OCI exporter for multi-arch: https://github.com/docker/buildx/pull/1813
|
# Must use OCI exporter for multi-arch: https://github.com/docker/buildx/pull/1813
|
||||||
outputs: type=oci,dest=/tmp/radius-docker.tar
|
outputs: type=oci,dest=/tmp/radius-docker.tar
|
||||||
|
@ -53,7 +59,7 @@ jobs:
|
||||||
# This step is split so that we don't apply "packages: write" permission
|
# This step is split so that we don't apply "packages: write" permission
|
||||||
# except when uploading the final Docker image to GHCR.
|
# except when uploading the final Docker image to GHCR.
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.ref == 'refs/heads/master' && github.repository == 'kanidm/kanidm'
|
if: ( github.ref_type == 'tag' || github.ref == 'refs/heads/master' ) && github.repository == 'kanidm/kanidm'
|
||||||
needs: radius_build
|
needs: radius_build
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
|
|
Loading…
Reference in a new issue