-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·87 lines (73 loc) · 2.32 KB
/
pdns-auth.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build & Push PowerDNS Authoritative
on:
push:
branches:
- 'main'
env:
ORG_NAME: lostlink
APP_NAME: pdns-auth
jobs:
should_deploy:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
lfs: true
- name: Detect File Changes
uses: trilom/[email protected]
- name: Changed Files List
run: |
jq -r '.[]' $HOME/files.json
- name: Filter and set Build Status
id: build
run: |
unique_entries=$(jq -r '.[] | select(test("${{ env.APP_NAME }}"))' $HOME/files.json | awk -v RS=' ' '!a[$1]++')
if [[ ! -z "$unique_entries" ]]
then
status="deploy"
else
status="skip"
fi
echo "status=$status" >> $GITHUB_OUTPUT
outputs:
status: ${{ steps.build.outputs.status }}
deploy:
runs-on: ubuntu-latest
needs: should_deploy
if: needs.should_deploy.outputs.status == 'deploy'
strategy:
fail-fast: false
matrix:
build:
- {tag: "4.7", version: "4.7", platforms: "linux/arm/v7,linux/arm64,linux/amd64"}
# - {tag: "4.8", version: "4.8", platforms: "linux/arm/v7,linux/arm64,linux/amd64"}
- {tag: "latest", version: "4.7", platforms: "linux/arm/v7,linux/arm64,linux/amd64"}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
lfs: true
- name: Import environment variables from a file
uses: cardinalby/export-env-action@v2
with:
envFile: 'docker.env'
expand: 'true'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:${{ env.APP_NAME }}"
platforms: ${{ matrix.build.platforms }}
push: true
tags: ${{ env.ORG_NAME }}/${{ env.APP_NAME }}:${{ matrix.build.tag }}
build-args: |
"PDNS_VERSION=${{ matrix.build.version }}"