Update Github actions

This commit is contained in:
Alexey Pustovalov 2024-02-05 13:16:42 +09:00
parent defd042ae8
commit ea172a0ea5
3 changed files with 46 additions and 55 deletions

View File

@ -6,9 +6,9 @@ on:
- published - published
push: push:
branches: branches:
- '4.0'
- '5.0' - '5.0'
- '6.0' - '6.0'
- '6.4'
- 'trunk' - 'trunk'
paths: paths:
- 'Dockerfiles/**' - 'Dockerfiles/**'
@ -38,7 +38,7 @@ jobs:
is_default_branch: ${{ steps.branch_info.outputs.is_default_branch }} is_default_branch: ${{ steps.branch_info.outputs.is_default_branch }}
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
@ -107,23 +107,23 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v3
with: with:
image: tonistiigi/binfmt:latest image: tonistiigi/binfmt:latest
platforms: all platforms: all
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v3
with: with:
driver-opts: image=moby/buildkit:master driver-opts: image=moby/buildkit:master
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
@ -138,7 +138,7 @@ jobs:
- name: Generate tags - name: Generate tags
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: ${{ env.DOCKER_REPOSITORY }}/zabbix-${{ env.BASE_BUILD_NAME }} images: ${{ env.DOCKER_REPOSITORY }}/zabbix-${{ env.BASE_BUILD_NAME }}
tags: | tags: |
@ -152,7 +152,7 @@ jobs:
- name: Build ${{ env.BASE_BUILD_NAME }}/${{ matrix.os }} and push - name: Build ${{ env.BASE_BUILD_NAME }}/${{ matrix.os }} and push
id: docker_build id: docker_build
uses: docker/build-push-action@v4 uses: docker/build-push-action@v5
with: with:
context: ./Dockerfiles/${{ env.BASE_BUILD_NAME }}/${{ matrix.os }} context: ./Dockerfiles/${{ env.BASE_BUILD_NAME }}/${{ matrix.os }}
file: ./Dockerfiles/${{ env.BASE_BUILD_NAME }}/${{ matrix.os }}/Dockerfile file: ./Dockerfiles/${{ env.BASE_BUILD_NAME }}/${{ matrix.os }}/Dockerfile
@ -169,7 +169,7 @@ jobs:
echo "${{ steps.docker_build.outputs.digest }}" > ${{ env.BASE_BUILD_NAME }}_${{ matrix.os }} echo "${{ steps.docker_build.outputs.digest }}" > ${{ env.BASE_BUILD_NAME }}_${{ matrix.os }}
- name: Upload SHA256 tag - name: Upload SHA256 tag
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ${{ env.BASE_BUILD_NAME }}_${{ matrix.os }} name: ${{ env.BASE_BUILD_NAME }}_${{ matrix.os }}
path: ${{ env.BASE_BUILD_NAME }}_${{ matrix.os }} path: ${{ env.BASE_BUILD_NAME }}_${{ matrix.os }}
@ -185,24 +185,24 @@ jobs:
build: ${{ fromJson(needs.init_build.outputs.database) }} build: ${{ fromJson(needs.init_build.outputs.database) }}
os: ${{ fromJson(needs.init_build.outputs.os) }} os: ${{ fromJson(needs.init_build.outputs.os) }}
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v3
with: with:
image: tonistiigi/binfmt:latest image: tonistiigi/binfmt:latest
platforms: all platforms: all
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v3
with: with:
driver-opts: image=moby/buildkit:master driver-opts: image=moby/buildkit:master
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
@ -217,7 +217,7 @@ jobs:
- name: Generate tags - name: Generate tags
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: ${{ env.DOCKER_REPOSITORY }}/zabbix-${{ matrix.build }} images: ${{ env.DOCKER_REPOSITORY }}/zabbix-${{ matrix.build }}
tags: | tags: |
@ -230,7 +230,7 @@ jobs:
latest=${{ (matrix.os == 'alpine') && ( github.event_name == 'push' ) && ( needs.init_build.outputs.is_default_branch == 'true' ) }} latest=${{ (matrix.os == 'alpine') && ( github.event_name == 'push' ) && ( needs.init_build.outputs.is_default_branch == 'true' ) }}
- name: Download SHA256 tag build-base:${{ matrix.os }} - name: Download SHA256 tag build-base:${{ matrix.os }}
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: build-base_${{ matrix.os }} name: build-base_${{ matrix.os }}
@ -245,7 +245,7 @@ jobs:
- name: Build ${{ matrix.build }}/${{ matrix.os }} and push - name: Build ${{ matrix.build }}/${{ matrix.os }} and push
id: docker_build id: docker_build
uses: docker/build-push-action@v4 uses: docker/build-push-action@v5
with: with:
context: ./Dockerfiles/${{ matrix.build }}/${{ matrix.os }} context: ./Dockerfiles/${{ matrix.build }}/${{ matrix.os }}
file: ./Dockerfiles/${{ matrix.build }}/${{ matrix.os }}/Dockerfile file: ./Dockerfiles/${{ matrix.build }}/${{ matrix.os }}/Dockerfile
@ -263,7 +263,7 @@ jobs:
echo "${{ steps.docker_build.outputs.digest }}" > ${{ matrix.build }}_${{ matrix.os }} echo "${{ steps.docker_build.outputs.digest }}" > ${{ matrix.build }}_${{ matrix.os }}
- name: Upload SHA256 tag - name: Upload SHA256 tag
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.build }}_${{ matrix.os }} name: ${{ matrix.build }}_${{ matrix.os }}
path: ${{ matrix.build }}_${{ matrix.os }} path: ${{ matrix.build }}_${{ matrix.os }}
@ -279,23 +279,23 @@ jobs:
build: ${{ fromJson(needs.init_build.outputs.components) }} build: ${{ fromJson(needs.init_build.outputs.components) }}
os: ${{ fromJson(needs.init_build.outputs.os) }} os: ${{ fromJson(needs.init_build.outputs.os) }}
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v3
with: with:
image: tonistiigi/binfmt:latest image: tonistiigi/binfmt:latest
platforms: all platforms: all
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v3
with: with:
driver-opts: image=moby/buildkit:master driver-opts: image=moby/buildkit:master
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
@ -336,7 +336,7 @@ jobs:
- name: Generate tags - name: Generate tags
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: ${{ env.DOCKER_REPOSITORY }}/zabbix-${{ matrix.build }} images: ${{ env.DOCKER_REPOSITORY }}/zabbix-${{ matrix.build }}
tags: | tags: |
@ -349,7 +349,7 @@ jobs:
latest=${{ (matrix.os == 'alpine') && ( github.event_name == 'push' ) && ( needs.init_build.outputs.is_default_branch == 'true' ) }} latest=${{ (matrix.os == 'alpine') && ( github.event_name == 'push' ) && ( needs.init_build.outputs.is_default_branch == 'true' ) }}
- name: Download SHA256 tag for ${{ steps.build_base_image.outputs.build_base }}:${{ matrix.os }} - name: Download SHA256 tag for ${{ steps.build_base_image.outputs.build_base }}:${{ matrix.os }}
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
if: ${{ matrix.build != 'snmptraps' }} if: ${{ matrix.build != 'snmptraps' }}
with: with:
name: ${{ steps.build_base_image.outputs.build_base }}_${{ matrix.os }} name: ${{ steps.build_base_image.outputs.build_base }}_${{ matrix.os }}
@ -366,7 +366,7 @@ jobs:
- name: Build ${{ matrix.build }}/${{ matrix.os }} and push - name: Build ${{ matrix.build }}/${{ matrix.os }} and push
id: docker_build id: docker_build
uses: docker/build-push-action@v4 uses: docker/build-push-action@v5
with: with:
context: ./Dockerfiles/${{ matrix.build }}/${{ matrix.os }} context: ./Dockerfiles/${{ matrix.build }}/${{ matrix.os }}
file: ./Dockerfiles/${{ matrix.build }}/${{ matrix.os }}/Dockerfile file: ./Dockerfiles/${{ matrix.build }}/${{ matrix.os }}/Dockerfile

View File

@ -4,15 +4,6 @@ on:
release: release:
types: types:
- published - published
push:
branches:
- '5.0'
- '6.0'
- '6.2'
paths:
- '!**/README.md'
- 'Dockerfiles/*/rhel/*'
- '.github/workflows/images_build_rhel.yml'
defaults: defaults:
run: run:
@ -37,7 +28,7 @@ jobs:
sha_short: ${{ steps.branch_info.outputs.sha_short }} sha_short: ${{ steps.branch_info.outputs.sha_short }}
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
@ -85,13 +76,13 @@ jobs:
image: ${{ steps.build_image.outputs.image-with-tag }} image: ${{ steps.build_image.outputs.image-with-tag }}
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
- name: Generate tags - name: Generate tags
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: zabbix-${{ matrix.build }} images: zabbix-${{ matrix.build }}
tags: | tags: |
@ -121,13 +112,13 @@ jobs:
runs-on: self-hosted runs-on: self-hosted
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
- name: Generate tags - name: Generate tags
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: zabbix-build-${{ matrix.build }} images: zabbix-build-${{ matrix.build }}
tags: | tags: |
@ -155,7 +146,7 @@ jobs:
runs-on: self-hosted runs-on: self-hosted
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Detect Build Base Image - name: Detect Build Base Image
id: build_base_image id: build_base_image
@ -166,7 +157,7 @@ jobs:
echo "build_base=$BUILD_BASE" >> $GITHUB_OUTPUT echo "build_base=$BUILD_BASE" >> $GITHUB_OUTPUT
- name: Genarate image name - name: Generate image name
id: image_name id: image_name
env: env:
REDHAT_CERTIFY_CREDENTIALS: ${{ secrets.REDHAT_CERTIFY_CREDENTIALS }} REDHAT_CERTIFY_CREDENTIALS: ${{ secrets.REDHAT_CERTIFY_CREDENTIALS }}
@ -192,7 +183,7 @@ jobs:
echo "password=$REGISTRY_PASSWORD" >> $GITHUB_OUTPUT echo "password=$REGISTRY_PASSWORD" >> $GITHUB_OUTPUT
- name: Log in to Quay.io - name: Log in to Quay.io
uses: redhat-actions/podman-login@v1.5 uses: redhat-actions/podman-login@v1.6
env: env:
LOGIN: ${{ steps.login_credentials.outputs.username }} LOGIN: ${{ steps.login_credentials.outputs.username }}
PASSWORD: ${{ steps.login_credentials.outputs.password }} PASSWORD: ${{ steps.login_credentials.outputs.password }}
@ -209,7 +200,7 @@ jobs:
- name: Generate tags - name: Generate tags
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: ${{ env.REGISTRY }}/${{ env.REGISTRY_NAMESPACE }}/${{ steps.image_name.outputs.image_name }} images: ${{ env.REGISTRY }}/${{ env.REGISTRY_NAMESPACE }}/${{ steps.image_name.outputs.image_name }}
tags: | tags: |

View File

@ -6,9 +6,9 @@ on:
- published - published
push: push:
branches: branches:
- '4.0'
- '5.0' - '5.0'
- '6.0' - '6.0'
- '6.4'
- 'trunk' - 'trunk'
paths: paths:
- 'Dockerfiles/*/windows/*' - 'Dockerfiles/*/windows/*'
@ -37,7 +37,7 @@ jobs:
is_default_branch: ${{ steps.branch_info.outputs.is_default_branch }} is_default_branch: ${{ steps.branch_info.outputs.is_default_branch }}
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
fetch-depth: 1 fetch-depth: 1
@ -99,7 +99,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v5
with: with:
fetch-depth: 1 fetch-depth: 1
@ -116,7 +116,7 @@ jobs:
- name: Generate tags - name: Generate tags
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: ${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGE_PREFIX }}${{ env.BASE_BUILD_NAME }} images: ${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGE_PREFIX }}${{ env.BASE_BUILD_NAME }}
tags: | tags: |
@ -172,7 +172,7 @@ jobs:
- name: Upload SHA256 tag - name: Upload SHA256 tag
if: ${{ env.AUTO_PUSH_IMAGES }} if: ${{ env.AUTO_PUSH_IMAGES }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ${{ env.BASE_BUILD_NAME }}${{ env.BASE_BUILD_ARTIFACT_FILE_SUFFIX }} name: ${{ env.BASE_BUILD_NAME }}${{ env.BASE_BUILD_ARTIFACT_FILE_SUFFIX }}
path: ${{ env.BASE_BUILD_NAME }}${{ env.BASE_BUILD_ARTIFACT_FILE_SUFFIX }} path: ${{ env.BASE_BUILD_NAME }}${{ env.BASE_BUILD_ARTIFACT_FILE_SUFFIX }}
@ -199,7 +199,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v5
- name: Login to DockerHub - name: Login to DockerHub
run: | run: |
@ -214,7 +214,7 @@ jobs:
- name: Generate tags - name: Generate tags
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: ${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGE_PREFIX }}${{ env.COMPONENT_BASE_BUILD_NAME }} images: ${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGE_PREFIX }}${{ env.COMPONENT_BASE_BUILD_NAME }}
tags: | tags: |
@ -227,7 +227,7 @@ jobs:
latest=false latest=false
- name: Download SHA256 tag build-base:${{ matrix.os }} - name: Download SHA256 tag build-base:${{ matrix.os }}
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: ${{ env.BASE_BUILD_NAME }}${{ env.BASE_BUILD_ARTIFACT_FILE_SUFFIX }} name: ${{ env.BASE_BUILD_NAME }}${{ env.BASE_BUILD_ARTIFACT_FILE_SUFFIX }}
@ -284,7 +284,7 @@ jobs:
- name: Upload SHA256 tag - name: Upload SHA256 tag
if: ${{ env.AUTO_PUSH_IMAGES }} if: ${{ env.AUTO_PUSH_IMAGES }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: ${{ env.COMPONENT_BASE_BUILD_NAME }}${{ env.COMPONENT_BASE_BUILD_ARTIFACT_FILE_SUFFIX }} name: ${{ env.COMPONENT_BASE_BUILD_NAME }}${{ env.COMPONENT_BASE_BUILD_ARTIFACT_FILE_SUFFIX }}
path: ${{ env.COMPONENT_BASE_BUILD_NAME }}${{ env.COMPONENT_BASE_BUILD_ARTIFACT_FILE_SUFFIX }} path: ${{ env.COMPONENT_BASE_BUILD_NAME }}${{ env.COMPONENT_BASE_BUILD_ARTIFACT_FILE_SUFFIX }}
@ -324,7 +324,7 @@ jobs:
- name: Generate tags - name: Generate tags
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: ${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGE_PREFIX }}${{ matrix.component }} images: ${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGE_PREFIX }}${{ matrix.component }}
tags: | tags: |
@ -337,7 +337,7 @@ jobs:
latest=false latest=false
- name: Download SHA256 tag for ${{ env.COMPONENT_BASE_BUILD_NAME }}:${{ matrix.os }} - name: Download SHA256 tag for ${{ env.COMPONENT_BASE_BUILD_NAME }}:${{ matrix.os }}
uses: actions/download-artifact@v3 uses: actions/download-artifact@v4
with: with:
name: ${{ env.COMPONENT_BASE_BUILD_NAME }}${{ env.COMPONENT_BASE_BUILD_ARTIFACT_FILE_SUFFIX }} name: ${{ env.COMPONENT_BASE_BUILD_NAME }}${{ env.COMPONENT_BASE_BUILD_ARTIFACT_FILE_SUFFIX }}