zabbix-docker/.github/workflows/nightly_build_azure.yml

90 lines
2.2 KiB
YAML
Raw Normal View History

2022-02-15 11:16:03 +01:00
name: Azure (nightly build)
on:
schedule:
- cron: '5 2 * * *'
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
strategy:
fail-fast: false
matrix:
build:
- agent
- agent2
- java-gateway
- proxy-mysql
- proxy-sqlite3
- server-mysql
- server-pgsql
- snmptraps
- web-apache-mysql
- web-apache-pgsql
- web-nginx-mysql
- web-nginx-pgsql
- web-service
os:
- alpine
- ubuntu
- ol
runs-on: ubuntu-20.04
steps:
-
uses: actions/checkout@v2
with:
ref: "refs/heads/trunk"
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Prepare platform list
id: platform
run: |
DOCKER_PLATFORM="linux/amd64,linux/arm64"
echo ::set-output name=list::${DOCKER_PLATFORM}
- name: Prepare environment (schedule)
id: prepare
run: |
TAGS_ARRAY=()
IMAGE_NAME="${{ secrets.azure_registry }}.azurecr.io/${{ matrix.os }}/zabbix-${{ matrix.build }}"
TAGS_ARRAY+=("$IMAGE_NAME:trunk")
TAGS=$(printf -- "%s, " "${TAGS_ARRAY[@]}")
echo "::debug::Tags - ${TAGS}"
echo ::set-output name=image_name::${IMAGE_NAME}
echo ::set-output name=image_tag_versions::$(printf -- "%s," "${TAGS_ARRAY[@]}")
-
name: Login to Azure
uses: docker/login-action@v1
with:
registry: ${{ secrets.azure_registry }}.azurecr.io
username: ${{ secrets.AZURE_USERNAME }}
password: ${{ secrets.AZURE_PASSWORD }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./${{ matrix.build }}/${{ matrix.os }}
file: ./${{ matrix.build }}/${{ matrix.os }}/Dockerfile
platforms: ${{ steps.platform.outputs.list }}
push: ${{ secrets.AUTO_PUSH_IMAGES }}
tags: ${{ steps.prepare.outputs.image_tag_versions }}