Skip to content

Commit d0bce70

Browse files
authored
Merge pull request #1906 from pi-hole/dev-is-dev-is-nightly
Drop the development tag, reduce dupliation in build yaml
2 parents 6b685bb + 00a1263 commit d0bce70

File tree

2 files changed

+21
-52
lines changed

2 files changed

+21
-52
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 19 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
env:
1313
dockerhub: ${{ secrets.DOCKERHUB_NAMESPACE }}/pihole
1414
ghcr: ghcr.io/${{ github.repository_owner }}/pihole
15-
components_branch: ${{ github.event_name == 'schedule' && 'development' || 'master' }}
15+
components_branch: ${{ github.event_name == 'release' && 'master' || 'development' }}
1616

1717
jobs:
1818
build:
@@ -40,17 +40,20 @@ jobs:
4040
platform=${{ matrix.platform }}
4141
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
4242
43-
- name: Checkout Repo
43+
- &checkout-repo
44+
name: Checkout Repo
4445
if: github.event_name != 'schedule'
4546
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
4647

47-
- name: Checkout dev branch if scheduled
48+
- &checkout-dev
49+
name: Checkout dev branch if scheduled
4850
if: github.event_name == 'schedule'
4951
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
5052
with:
5153
ref: development
5254

53-
- name: Docker meta
55+
- &docker-meta
56+
name: Docker meta
5457
id: meta
5558
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f #v5.8.0
5659
with:
@@ -62,17 +65,18 @@ jobs:
6265
latest=${{ startsWith(github.ref, 'refs/tags/') }}
6366
tags: |
6467
type=schedule,pattern=nightly
65-
type=ref,event=branch,enable=${{ github.event_name != 'schedule' }}
68+
type=raw,value=nightly,enable=${{ github.event_name == 'push' }}
6669
type=ref,event=tag
6770
68-
-
71+
- &login-dockerhub
6972
name: Login to Docker Hub
7073
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #v3.6.0
7174
with:
7275
registry: docker.io
7376
username: ${{ secrets.DOCKERHUB_USER }}
7477
password: ${{ secrets.DOCKERHUB_PASS }}
75-
-
78+
79+
- &login-ghcr
7680
name: Login to GitHub Container Registry
7781
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #v3.6.0
7882
with:
@@ -85,7 +89,8 @@ jobs:
8589
with:
8690
platforms: ${{ matrix.platform}}
8791

88-
- name: Set up Docker Buildx
92+
- &setup-buildx
93+
name: Set up Docker Buildx
8994
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #v3.11.1
9095

9196
- name: Build container and push by digest
@@ -126,15 +131,8 @@ jobs:
126131
needs:
127132
- build
128133
steps:
129-
- name: Checkout Repo
130-
if: github.event_name != 'schedule'
131-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
132-
133-
- name: Checkout dev branch if scheduled
134-
if: github.event_name == 'schedule'
135-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
136-
with:
137-
ref: development
134+
- *checkout-repo
135+
- *checkout-dev
138136

139137
- name: Download digests
140138
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 #v5.0.0
@@ -143,38 +141,10 @@ jobs:
143141
pattern: digests-*
144142
merge-multiple: true
145143

146-
- name: Set up Docker Buildx
147-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #v3.11.1
148-
149-
- name: Docker meta
150-
id: meta
151-
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 #v5.0.0
152-
with:
153-
github-token: ${{ secrets.GITHUB_TOKEN }}
154-
images: |
155-
${{ env.dockerhub }}
156-
${{ env.ghcr }}
157-
flavor: |
158-
latest=${{ startsWith(github.ref, 'refs/tags/') }}
159-
tags: |
160-
type=schedule,pattern=nightly
161-
type=ref,event=branch,enable=${{ github.event_name != 'schedule' }}
162-
type=ref,event=tag
163-
164-
-
165-
name: Login to Docker Hub
166-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #v3.6.0
167-
with:
168-
registry: docker.io
169-
username: ${{ secrets.DOCKERHUB_USER }}
170-
password: ${{ secrets.DOCKERHUB_PASS }}
171-
-
172-
name: Login to GitHub Container Registry
173-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef #v3.6.0
174-
with:
175-
registry: ghcr.io
176-
username: ${{ github.repository_owner }}
177-
password: ${{ secrets.GITHUB_TOKEN }}
144+
- *setup-buildx
145+
- *docker-meta
146+
- *login-dockerhub
147+
- *login-ghcr
178148

179149
- name: Create manifest list and push (DockerHub and GitHub Container Registry)
180150
working-directory: /tmp/digests

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,11 @@ Release notes will always contain full details of changes in the container, incl
200200

201201
| tag | description
202202
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
203-
| `latest` | Always latest release |
203+
| `latest` | Always the latest release |
204204
| `2022.04.0` | Date-based release |
205205
| `2022.04.1` | Second release in a given month |
206-
| `development` | Similar to `latest`, but for the development branch (pushed occasionally) |
207206
| `*beta` | Early beta releases of upcoming versions - here be dragons |
208-
| `nightly` | Like `development` but pushed every night and pulls from the latest `development` branches of the core Pi-hole components (Pi-hole, web, FTL) |
207+
| `nightly` | Built and pushed whenever there are changes on the `development` branch and additionally produced by the scheduled nightly job. These are the most experimental development images and may change frequently |
209208

210209
## Upgrading, Persistence, and Customizations
211210

0 commit comments

Comments
 (0)