Skip to content

Commit

Permalink
first try to migrate gitlab CI based build process to Github
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Anton committed Dec 30, 2024
1 parent c561136 commit a2ec5b6
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker.build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Docker Build and Push

on:
push:
branches:
- main

env:
IMAGE_NAME: ghcr.io/zabbix-community/zabbix-server-create-upgrade-db

jobs:
build-and-push:
name: Build and Push Multi-Arch Images
runs-on: ubuntu-latest
strategy:
matrix:
major_version: ["6.0", "6.4", "7.0", "7.2"]
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Multi-Arch Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
MAJOR_VERSION=${{ matrix.major_version }}
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ matrix.major_version }}-${{ github.run_id }}
${{ env.IMAGE_NAME }}:${{ matrix.major_version }}-latest

0 comments on commit a2ec5b6

Please sign in to comment.