Skip to content

build(deps): bump github.com/prometheus/client_golang (#292) #319

build(deps): bump github.com/prometheus/client_golang (#292)

build(deps): bump github.com/prometheus/client_golang (#292) #319

name: "Docker Package"
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:
- v*
env:
# TODO: Change variable to your image's name.
IMAGE_NAME: sdns
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: Version
id: get_version
run: |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[ "$VERSION" == "master" ] && VERSION=latest
echo ::set-output name=VERSION::$VERSION
- name: Build image
run: docker build -t docker.pkg.github.com/${{ github.repository }}/sdns:${{ steps.get_version.outputs.VERSION }} .
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Push image
run: docker push docker.pkg.github.com/${{ github.repository }}/sdns:${{ steps.get_version.outputs.VERSION }}