1
- name : Build and Publish (development-v6)
1
+ name : Build Image and Publish
2
2
on :
3
3
schedule :
4
4
- cron : " 0 5 * * *"
5
5
push :
6
6
branches :
7
- - development-v6
7
+ - development
8
+ release :
9
+ types : [published]
10
+
8
11
9
12
env :
10
13
dockerhub : ${{ secrets.DOCKERHUB_NAMESPACE }}/pihole
11
14
ghcr : ghcr.io/${{ github.repository_owner }}/pihole
15
+ components_branch : ${{ startsWith(github.ref, 'refs/tags/') && 'master' || 'development' }}
12
16
13
17
jobs :
14
18
build :
29
33
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
30
34
31
35
- name : Checkout Repo
36
+ if : github.event_name != 'schedule'
37
+ uses : actions/checkout@v4
38
+
39
+ - name : Checkout dev branch if scheduled
40
+ if : github.event_name == 'schedule'
32
41
uses : actions/checkout@v4
33
42
with :
34
- ref : development-v6
43
+ ref : development
35
44
36
45
- name : Docker meta
37
46
id : meta
42
51
${{ env.dockerhub }}
43
52
${{ env.ghcr }}
44
53
flavor : |
45
- latest=false
54
+ latest=${{ startsWith(github.ref, 'refs/tags/') }}
46
55
tags : |
47
- development-v6
56
+ type=schedule,pattern=nightly
57
+ type=ref,event=branch,enable=${{ github.event_name != 'schedule' }}
58
+ type=ref,event=tag
48
59
49
60
- name : Login to DockerHub and GitHub Container Registry
50
61
uses : ./.github/actions/login-repo
70
81
platforms : ${{ matrix.platform }}
71
82
build-args : |
72
83
PIHOLE_DOCKER_TAG=${{ steps.meta.outputs.version }}
73
- alpine_version=${{ matrix.alpine_version }}
84
+ alpine_version=${{ matrix.alpine_version }}
85
+ FTL_BRANCH=${{ env.components_branch }}
86
+ CORE_BRANCH=${{ env.components_branch }}
87
+ WEB_BRANCH=${{ env.components_branch }}
88
+ PADD_BRANCH=${{ env.components_branch }}
74
89
labels : ${{ steps.meta.outputs.labels }}
75
90
outputs : |
76
91
type=image,name=${{ env.dockerhub }},push-by-digest=true,name-canonical=true,push=true
@@ -98,9 +113,14 @@ jobs:
98
113
- build
99
114
steps :
100
115
- name : Checkout Repo
116
+ if : github.event_name != 'schedule'
117
+ uses : actions/checkout@v4
118
+
119
+ - name : Checkout dev branch if scheduled
120
+ if : github.event_name == 'schedule'
101
121
uses : actions/checkout@v4
102
122
with :
103
- ref : development-v6
123
+ ref : development
104
124
105
125
- name : Download digests
106
126
uses : actions/download-artifact@v4
@@ -121,9 +141,11 @@ jobs:
121
141
${{ env.dockerhub }}
122
142
${{ env.ghcr }}
123
143
flavor : |
124
- latest=false
144
+ latest=${{ startsWith(github.ref, 'refs/tags/') }}
125
145
tags : |
126
- development-v6
146
+ type=schedule,pattern=nightly
147
+ type=ref,event=branch,enable=${{ github.event_name != 'schedule' }}
148
+ type=ref,event=tag
127
149
128
150
- name : Login to DockerHub and GitHub Container Registry
129
151
uses : ./.github/actions/login-repo
0 commit comments