Skip to content

[NuGet](deps): Bump NCronJob from 4.0.2 to 4.1.0 in the others group … #1554

[NuGet](deps): Bump NCronJob from 4.0.2 to 4.1.0 in the others group …

[NuGet](deps): Bump NCronJob from 4.0.2 to 4.1.0 in the others group … #1554

Workflow file for this run

name: Build Docker Image
on:
push:
branches:
- "dependabot/**"
- "dev/**"
- "main"
- "rel/**"
paths:
- "**.cs"
- "**.csproj"
- "**.json"
- "**.props"
- "**.sln"
- "CHANGELOG.md"
- "**.Dockerfile"
- "**/docker.yml"
workflow_dispatch:
permissions:
actions: write
checks: write
contents: read
jobs:
extract_meta:
name: Extract metadata for use
runs-on: ubuntu-24.04
outputs:
clean_version: ${{ steps.get-version.outputs.clean_version }}
version: ${{ steps.get-version.outputs.version }}
environment: ${{ steps.get-environment.outputs.environment }}
environment_alpine: ${{ steps.get-environment.outputs.environment_alpine }}
config: ${{ steps.get-config.outputs.config }}
dockerfile: ${{ steps.get-dockerfile.outputs.dockerfile }}
dockerfile_alpine: ${{ steps.get-dockerfile.outputs.dockerfile_alpine }}
datetime: ${{ steps.get-datetime.outputs.time }}
loc_cs: ${{ steps.get-loc_cs.outputs.total_lines }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: Get version from Directory.Build.props
id: get-version
run: |
VERSION=$(grep -oP '(?<=<Version>).*?(?=</Version>)' Directory.Build.props)
echo "version=v$VERSION" >> "$GITHUB_OUTPUT"
echo "clean_version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Get build environment
id: get-environment
run: |
if ${{ contains(github.event.head_commit.message, '[release]') || contains(github.event.head_commit.message, '[pre-release]') || contains(github.event.ref, 'rel/') || contains(github.event.ref, 'dev/') || contains(github.event.ref, 'dependabot/') }}; then
echo "environment=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
echo "environment_alpine=${{ github.ref_name }}-alpine" >> "$GITHUB_OUTPUT"
elif ${{ contains(github.ref_name, 'main') && (!contains(github.event.head_commit.message, '[pre-release]') || !contains(github.event.head_commit.message, '[release]')) }}; then
echo "environment=dev" >> "$GITHUB_OUTPUT"
echo "environment_alpine=dev-alpine" >> "$GITHUB_OUTPUT"
fi
- name: Get build config
id: get-config
run: |
if ${{ (contains(github.event.head_commit.message, '[release]') || contains(github.event.head_commit.message, '[pre-release]') || contains(github.event.ref, 'rel/')) }}; then
echo "config=Docker" >> "$GITHUB_OUTPUT"
else
echo "config=Docker-debug" >> "$GITHUB_OUTPUT"
fi
- name: Get correct Dockerfile
id: get-dockerfile
run: |
if [[ "${{ steps.get-config.outputs.config }}" == "Docker" ]]; then
echo "dockerfile=release.Dockerfile" >> "$GITHUB_OUTPUT"
echo "dockerfile_alpine=release.alpine.Dockerfile" >> "$GITHUB_OUTPUT"
else
echo "dockerfile=dev.Dockerfile" >> "$GITHUB_OUTPUT"
echo "dockerfile_alpine=dev.alpine.Dockerfile" >> "$GITHUB_OUTPUT"
fi
- name: Get Date and Time
id: get-datetime
uses: Kaven-Universe/github-action-current-date-time@f2c12d90cff9c3e7b1f50430886e632fe31fcee1
with:
format: "YYYY-MM-DDTHH:mm:ss"
- name: Calculate Lines of Source Code
if: ${{ github.actor != 'dependabot[bot]' }}
id: get-loc_cs
uses: PavanMudigonda/lines-of-code-reporter@6c5507f592136d1c05cb1e8c30889dc4eb5561f5
with:
include_lang: "C#,MSBuild script"
docker-build-amd:
name: Build Docker Image For ${{ matrix.os }} - ${{ matrix.arch }}
needs: [extract_meta]
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- os: linux
arch: amd64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
flavor: latest=${{ contains(github.event.head_commit.message, '[release]') || contains(github.event.ref, 'rel/') }}
images: sellagh/azzybot
tags: type=raw,value=${{ needs.extract_meta.outputs.environment }}
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
- name: Log into Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
with:
build-args: |
CONFIG=${{ needs.extract_meta.outputs.config }}
COMMIT=${{ github.sha }}
TIMESTAMP=${{ needs.extract_meta.outputs.datetime }}
LOC_CS=${{ needs.extract_meta.outputs.loc_cs }}
context: .
file: ${{ needs.extract_meta.outputs.dockerfile }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.os }}/${{ matrix.arch }}
outputs: type=image,name=sellagh/azzybot,push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b
with:
name: debian-${{ matrix.os }}-${{ matrix.arch }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
docker-build-alpine-amd:
name: Build Docker Alpine Image For ${{ matrix.os }} - ${{ matrix.arch }}
needs: [extract_meta]
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- os: linux
arch: amd64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Docker meta
if: ${{ !contains(github.event.head_commit.message, '[release]') && !contains(github.event.head_commit.message, '[pre-release]') && !contains(github.event.ref, 'rel/') }}
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
flavor: latest=false
images: sellagh/azzybot
tags: type=raw,value=${{ needs.extract_meta.outputs.environment_alpine }}
- name: Docker meta
if: ${{ contains(github.event.head_commit.message, '[release]') || contains(github.event.head_commit.message, '[pre-release]') || contains(github.event.ref, 'rel/') }}
id: meta-latest
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
flavor: latest=false
images: sellagh/azzybot
tags: |
type=raw,value=${{ needs.extract_meta.outputs.environment_alpine }}
type=raw,value=latest-alpine
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
- name: Log into Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
with:
build-args: |
CONFIG=${{ needs.extract_meta.outputs.config }}
COMMIT=${{ github.sha }}
TIMESTAMP=${{ needs.extract_meta.outputs.datetime }}
LOC_CS=${{ needs.extract_meta.outputs.loc_cs }}
context: .
file: ${{ needs.extract_meta.outputs.dockerfile_alpine }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.os }}/${{ matrix.arch }}
outputs: type=image,name=sellagh/azzybot,push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b
with:
name: alpine-${{ matrix.os }}-${{ matrix.arch }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
docker-build-arm:
name: Build Docker Image For ${{ matrix.os }} - ${{ matrix.arch }}
needs: [extract_meta]
runs-on: self-hosted
strategy:
matrix:
include:
- os: linux
arch: arm64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
flavor: latest=${{ contains(github.event.head_commit.message, '[release]') || contains(github.event.ref, 'rel/') }}
images: sellagh/azzybot
tags: type=raw,value=${{ needs.extract_meta.outputs.environment }}
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
- name: Log into Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
with:
build-args: |
CONFIG=${{ needs.extract_meta.outputs.config }}
COMMIT=${{ github.sha }}
TIMESTAMP=${{ needs.extract_meta.outputs.datetime }}
LOC_CS=${{ needs.extract_meta.outputs.loc_cs }}
context: .
file: ${{ needs.extract_meta.outputs.dockerfile }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.os }}/${{ matrix.arch }}
outputs: type=image,name=sellagh/azzybot,push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b
with:
name: debian-${{ matrix.os }}-${{ matrix.arch }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
- name: Cleanup Runner
if: always()
run: |
cd /home/runner/actions-runner/_work
rm -rf /tmp/digests
# docker stop $(docker ps -a -q)
# docker system prune -a -f --volumes
# docker volume prune -a -f
docker-build-alpine-arm:
name: Build Docker Alpine Image For ${{ matrix.os }} - ${{ matrix.arch }}
needs: [extract_meta]
runs-on: self-hosted
strategy:
matrix:
include:
- os: linux
arch: arm64
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Docker meta
if: ${{ !contains(github.event.head_commit.message, '[release]') && !contains(github.event.head_commit.message, '[pre-release]') && !contains(github.event.ref, 'rel/') }}
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
flavor: latest=false
images: sellagh/azzybot
tags: type=raw,value=${{ needs.extract_meta.outputs.environment_alpine }}
- name: Docker meta
if: ${{ contains(github.event.head_commit.message, '[release]') || contains(github.event.head_commit.message, '[pre-release]') || contains(github.event.ref, 'rel/') }}
id: meta-latest
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
flavor: latest=false
images: sellagh/azzybot
tags: |
type=raw,value=${{ needs.extract_meta.outputs.environment_alpine }}
type=raw,value=latest-alpine
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
- name: Log into Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
with:
build-args: |
CONFIG=${{ needs.extract_meta.outputs.config }}
COMMIT=${{ github.sha }}
TIMESTAMP=${{ needs.extract_meta.outputs.datetime }}
LOC_CS=${{ needs.extract_meta.outputs.loc_cs }}
context: .
file: ${{ needs.extract_meta.outputs.dockerfile_alpine }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.os }}/${{ matrix.arch }}
outputs: type=image,name=sellagh/azzybot,push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b
with:
name: alpine-${{ matrix.os }}-${{ matrix.arch }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
- name: Cleanup Runner
if: always()
run: |
cd /home/runner/actions-runner/_work
rm -rf /tmp/digests
# docker stop $(docker ps -a -q)
# docker system prune -a -f --volumes
# docker volume prune -a -f
merge:
name: Creating Docker Release
runs-on: ubuntu-24.04
needs: [extract_meta, docker-build-amd, docker-build-alpine-amd, docker-build-arm, docker-build-alpine-arm]
steps:
- name: Download digests
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
path: /tmp/digests
pattern: debian-*
merge-multiple: true
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
- name: Docker meta
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
flavor: latest=${{ contains(github.event.head_commit.message, '[release]') || contains(github.event.ref, 'rel/') }}
images: sellagh/azzybot
tags: type=raw,value=${{ needs.extract_meta.outputs.environment }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'sellagh/azzybot@sha256:%s ' *)
merge-alpine:
name: Creating Docker Alpine Release
runs-on: ubuntu-24.04
needs: [extract_meta, docker-build-amd, docker-build-alpine-amd, docker-build-arm, docker-build-alpine-arm]
steps:
- name: Download digests
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
path: /tmp/digests
pattern: alpine-*
merge-multiple: true
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5
- name: Docker meta
if: ${{ !contains(github.event.head_commit.message, '[release]') && !contains(github.event.head_commit.message, '[pre-release]') && !contains(github.event.ref, 'rel/') }}
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
flavor: latest=false
images: sellagh/azzybot
tags: type=raw,value=${{ needs.extract_meta.outputs.environment_alpine }}
- name: Docker meta
if: ${{ contains(github.event.head_commit.message, '[release]') || contains(github.event.head_commit.message, '[pre-release]') || contains(github.event.ref, 'rel/') }}
id: meta-latest
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
flavor: latest=false
images: sellagh/azzybot
tags: |
type=raw,value=${{ needs.extract_meta.outputs.environment_alpine }}
type=raw,value=latest-alpine
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'sellagh/azzybot@sha256:%s ' *)