-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (36 loc) · 1.16 KB
/
publish-image.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Release image
on:
push:
branches:
- main
- renovate/**
permissions:
contents: read
packages: write
jobs:
get-versions:
name: Build and push image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract PowerDNS version
id: version
run: |
echo "powerdns=$(sed -nr 's/^ARG PDNS_VERSION=(.*)$/\1/p' Dockerfile)" >> "$GITHUB_OUTPUT"
- name: Generate tag
id: tag
run: |
echo "bare=${{ steps.version.outputs.powerdns }}" >> "$GITHUB_OUTPUT"
echo "full=${{ steps.version.outputs.powerdns }}-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
outputs:
tags: |
ghcr.io/${{ github.repository }}/powerdns:v${{ steps.tag.outputs.bare }}
ghcr.io/${{ github.repository }}/powerdns:v${{ steps.tag.outputs.full }}
release-image:
needs: [get-versions]
uses: txqueuelen/.github/.github/workflows/common-docker-releaser.yaml@main
with:
tags: ${{ needs.get-versions.outputs.tags }}
push: ${{ github.ref_name == github.event.repository.default_branch }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}