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

96 lines
2.7 KiB
YAML
Raw Normal View History

2021-08-24 18:30:58 +02:00
name: Azure
2021-08-24 18:02:13 +02:00
on:
release:
types:
- published
push:
branches:
- '5.0'
- '5.4'
paths-ignore:
- '.env*'
- 'docker-compose*.yaml'
- '*/rhel/*'
- "**.md"
defaults:
run:
shell: bash
jobs:
build:
timeout-minutes: 70
env:
LATEST_BRANCH: "${{ github.event.repository.default_branch }}"
DOCKER_REPOSITORY: "zabbix"
strategy:
fail-fast: false
matrix:
build:
- agent
2021-08-25 01:34:09 +02:00
# - agent2
# - java-gateway
# - proxy-mysql
## - proxy-sqlite3
# - server-mysql
# - server-pgsql
# - snmptraps
# - web-apache-mysql
# - web-apache-pgsql
# - web-nginx-mysql
# - web-nginx-pgsql
2021-08-24 18:02:13 +02:00
os:
- alpine
2021-08-25 01:18:38 +02:00
# - ubuntu
# - ol
2021-08-24 18:02:13 +02:00
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
2021-08-25 01:18:38 +02:00
- name: Detect branch name
id: extract_branch
2021-08-24 18:06:34 +02:00
shell: bash
2021-08-25 01:56:26 +02:00
run: |
GIT_BRANCH="${GITHUB_REF##*/}"
2021-08-25 02:17:41 +02:00
GIT_BRANCH=`expr "${GIT_BRANCH}" : '\([0-9]*\.[0-9]*\).*'`
2021-08-25 02:01:26 +02:00
echo ::set-output name=branch::${GIT_BRANCH}
2021-08-25 01:23:53 +02:00
- name: Detect Zabbix version
id: extract_release
shell: bash
2021-08-25 01:56:26 +02:00
run: echo "##[set-output name=release_version;]$(echo ${GITHUB_REF##*/})"
2021-08-24 18:06:34 +02:00
2021-08-25 01:34:09 +02:00
- name: ACR build (push)
if: github.event_name == 'push'
2021-08-25 01:18:38 +02:00
id: acr_push
2021-08-24 18:06:34 +02:00
uses: ams0/acr-task-github-action@v2
2021-08-24 18:02:13 +02:00
with:
service_principal: ${{ secrets.azure_service_principal }}
service_principal_password: ${{ secrets.azure_service_principal_password }}
tenant: ${{ secrets.azure_tenant }}
2021-08-24 18:09:59 +02:00
registry: ${{ secrets.azure_registry }}
2021-08-25 01:18:38 +02:00
repository: ${{ matrix.os }}
2021-08-24 19:15:40 +02:00
image: zabbix-${{ matrix.build }}
2021-08-24 18:02:13 +02:00
folder: ${{ matrix.build }}/${{ matrix.os }}
2021-08-24 18:06:34 +02:00
branch: ${{ steps.extract_branch.outputs.branch }}
2021-08-25 01:19:27 +02:00
tag: v${{ steps.extract_branch.outputs.branch }}
2021-08-25 01:18:38 +02:00
dockerfile: Dockerfile
- name: ACR build (release)
if: github.event_name == 'release' && github.event.action == 'published'
2021-08-25 01:19:27 +02:00
id: acr_release
2021-08-25 01:18:38 +02:00
uses: ams0/acr-task-github-action@v2
with:
service_principal: ${{ secrets.azure_service_principal }}
service_principal_password: ${{ secrets.azure_service_principal_password }}
tenant: ${{ secrets.azure_tenant }}
registry: ${{ secrets.azure_registry }}
repository: ${{ matrix.os }}
image: zabbix-${{ matrix.build }}
folder: ${{ matrix.build }}/${{ matrix.os }}
2021-08-25 01:56:26 +02:00
branch: ${{ steps.extract_branch.outputs.branch }}
2021-08-25 01:23:53 +02:00
tag: v${{ steps.extract_release.outputs.release_version}}
2021-08-24 18:15:45 +02:00
dockerfile: Dockerfile