add sentry release generation #152
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
pull_request: | |
jobs: | |
build-images: | |
name: Build Docker images for nginx and Zabbix | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: build nginx image without pushing (only outside master) | |
working-directory: config/nginx | |
if: ${{ github.ref != 'refs/heads/master' }} | |
run: | | |
docker buildx build \ | |
--platform linux/amd64 . | |
- name: build Zabbix agent image without pushing (only outside master) | |
working-directory: config/zabbix | |
if: ${{ github.ref != 'refs/heads/master' }} | |
run: | | |
docker buildx build \ | |
--platform linux/amd64 . | |
- name: build nginx image for ghcr.io and DockerHub | |
working-directory: config/nginx | |
if: ${{ github.ref == 'refs/heads/master' }} | |
env: | |
GITHUB_PACKAGE_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} | |
USERNAME: ${{ github.actor }} | |
run: | | |
echo ${GITHUB_PACKAGE_TOKEN} | docker login ghcr.io -u ${USERNAME} --password-stdin | |
echo ${DOCKER_HUB_TOKEN} | docker login -u paskal --password-stdin | |
docker buildx build --push \ | |
--platform linux/amd64,linux/arm64 \ | |
-t ghcr.io/paskal/nginx:latest -t paskal/nginx:latest . | |
- name: build Zabbix agent image for ghcr.io and DockerHub | |
working-directory: config/zabbix | |
if: ${{ github.ref == 'refs/heads/master' }} | |
env: | |
GITHUB_PACKAGE_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} | |
USERNAME: ${{ github.actor }} | |
run: | | |
echo ${GITHUB_PACKAGE_TOKEN} | docker login ghcr.io -u ${USERNAME} --password-stdin | |
echo ${DOCKER_HUB_TOKEN} | docker login -u paskal --password-stdin | |
docker buildx build --push \ | |
--platform linux/amd64,linux/arm64 \ | |
-t ghcr.io/paskal/zabbix-agent2:latest -t paskal/zabbix-agent2:latest . | |
- name: remote update of zabbix agent after rebuild | |
if: ${{ github.ref == 'refs/heads/master' }} | |
env: | |
UPDATER_KEY: ${{ secrets.UPDATER_KEY }} | |
run: curl -s https://hooks.favor-group.ru/update/zabbix/${UPDATER_KEY} |