added container building workflow

This commit is contained in:
Raymond Kuiper 2024-03-08 22:44:25 +01:00
parent 142aae75e0
commit e05c35a3ea

17
.github/workflows/publish-image.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: Publish Docker image to GHCR
on:
push
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GHCR.io
run: echo "${{ secret.GHCR_PAT }}" | docker login --username ${{ secret.GHCR_USER }} --password-stdin ghcr.io
- name: Build and tag image
run: docker build . -t ghcr.io/${{ secret.GHCR_USER }}/netbox-zabbix-sync:latest
- name: Push image to GHCR.io
run: docker push ghcr.io/${{ secret.GHCR_USER }}/netbox-zabbix-sync:latest