Skip to content

Commit

Permalink
Merge pull request #1626 from pi-hole/development-v6
Browse files Browse the repository at this point in the history
Development v6 -> dev
  • Loading branch information
PromoFaux authored Sep 2, 2024
2 parents 6239412 + d00f17f commit c38a6ea
Show file tree
Hide file tree
Showing 75 changed files with 851 additions and 2,539 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`{Please select 'base: dev' as target branch above! (you can delete this line)}`
`{Please select 'base: development' as target branch above! (you can delete this line)}`

<!--- Provide a general summary of your changes in the Title above -->

Expand Down
35 changes: 35 additions & 0 deletions .github/actions/login-repo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Login to container registries
description: Login to container registries Docker Hub and GitHub Container Registry

inputs:
# Actions cannot access secrets so pass them in as inputs
docker_username:
required: true
description: The username to use to login to Docker Hub
docker_password:
required: true
description: The password to use to login to Docker Hub
ghcr_username:
required: true
description: The username to use to login to GitHub Container Registry
ghcr_password:
required: true
description: The password to use to login to GitHub Container Registry

runs:
using: "composite"
steps:
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ inputs.ghcr_username }}
password: ${{ inputs.ghcr_password }}
37 changes: 4 additions & 33 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ updates:
interval: "weekly"
day: saturday
time: "10:00"
target-branch: dev
target-branch: development
reviewers:
- "pi-hole/docker-maintainers"
- package-ecosystem: "docker"
Expand All @@ -16,7 +16,7 @@ updates:
interval: "weekly"
day: saturday
time: "10:00"
target-branch: dev
target-branch: development
reviewers:
- "pi-hole/docker-maintainers"
- package-ecosystem: pip
Expand All @@ -26,35 +26,6 @@ updates:
day: saturday
time: "10:00"
open-pull-requests-limit: 10
target-branch: dev
target-branch: development
reviewers:
- "pi-hole/docker-maintainers"
# Maintain dependencies for GitHub Actions development-v6
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: saturday
time: "10:00"
target-branch: development-v6
reviewers:
- "pi-hole/docker-maintainers"
- package-ecosystem: "docker"
directory: "/src/"
schedule:
interval: "weekly"
day: saturday
time: "10:00"
target-branch: development-v6
reviewers:
- "pi-hole/docker-maintainers"
- package-ecosystem: pip
directory: "/test"
schedule:
interval: weekly
day: saturday
time: "10:00"
open-pull-requests-limit: 10
target-branch: development-v6
reviewers:
- "pi-hole/docker-maintainers"
- "pi-hole/docker-maintainers"
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: Build and Publish (development-v6)
name: Build Image and Publish
on:
schedule:
- cron: "0 5 * * *"
push:
branches:
- development-v6
- development
release:
types: [published]


env:
dockerhub: ${{ secrets.DOCKERHUB_NAMESPACE }}/pihole
ghcr: ghcr.io/${{ github.repository_owner }}/pihole
components_branch: ${{ startsWith(github.ref, 'refs/tags/') && 'master' || 'development' }}

jobs:
build:
Expand All @@ -29,9 +33,14 @@ jobs:
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Checkout Repo
if: github.event_name != 'schedule'
uses: actions/checkout@v4

- name: Checkout dev branch if scheduled
if: github.event_name == 'schedule'
uses: actions/checkout@v4
with:
ref: development-v6
ref: development

- name: Docker meta
id: meta
Expand All @@ -42,9 +51,11 @@ jobs:
${{ env.dockerhub }}
${{ env.ghcr }}
flavor: |
latest=false
latest=${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
development-v6
type=schedule,pattern=nightly
type=ref,event=branch,enable=${{ github.event_name != 'schedule' }}
type=ref,event=tag
- name: Login to DockerHub and GitHub Container Registry
uses: ./.github/actions/login-repo
Expand All @@ -70,7 +81,11 @@ jobs:
platforms: ${{ matrix.platform }}
build-args: |
PIHOLE_DOCKER_TAG=${{ steps.meta.outputs.version }}
alpine_version=${{ matrix.alpine_version }}
alpine_version=${{ matrix.alpine_version }}
FTL_BRANCH=${{ env.components_branch }}
CORE_BRANCH=${{ env.components_branch }}
WEB_BRANCH=${{ env.components_branch }}
PADD_BRANCH=${{ env.components_branch }}
labels: ${{ steps.meta.outputs.labels }}
outputs: |
type=image,name=${{ env.dockerhub }},push-by-digest=true,name-canonical=true,push=true
Expand Down Expand Up @@ -98,9 +113,14 @@ jobs:
- build
steps:
- name: Checkout Repo
if: github.event_name != 'schedule'
uses: actions/checkout@v4

- name: Checkout dev branch if scheduled
if: github.event_name == 'schedule'
uses: actions/checkout@v4
with:
ref: development-v6
ref: development

- name: Download digests
uses: actions/download-artifact@v4
Expand All @@ -121,9 +141,11 @@ jobs:
${{ env.dockerhub }}
${{ env.ghcr }}
flavor: |
latest=false
latest=${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
development-v6
type=schedule,pattern=nightly
type=ref,event=branch,enable=${{ github.event_name != 'schedule' }}
type=ref,event=tag
- name: Login to DockerHub and GitHub Container Registry
uses: ./.github/actions/login-repo
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Image and Test
on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Official docker images for docker are only available for amd64 and arm64
# TODO: Look at: https://github.com/docker-library/official-images#architectures-other-than-amd64
# Is testing on all platforms really necessary?
# Disabled arm64 tests for the time being, something is wrong with the test config and the volumes are getting shared between the test containers on different architectures
#platform: [linux/amd64, linux/arm64]
platform: [linux/amd64]
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.platform }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run Tests
run: |
echo "Building image to test"
PLATFORM=${{ matrix.platform }} ./build-and-test.sh
2 changes: 1 addition & 1 deletion .github/workflows/sync-back-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Opening pull request
run: gh pr create -B dev -H master --title 'Sync master back into development' --body 'Created by Github action' --label 'internal'
run: gh pr create -B development -H master --title 'Sync master back into development' --body 'Created by Github action' --label 'internal'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84 changes: 0 additions & 84 deletions .github/workflows/test-and-build.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ var-log/

# WIP/test stuff
doco.yml

# Ignore FTL Binary if it exists
src/pihole-FTL
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"github-actions.workflows.pinned.workflows": [
".github/workflows/v6-alpine-play.yml"
]
}
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Please review the following before opening a pull request (PR) to help your PR go smoothly:

* Code changes go to the `dev` branch first
* To ensure proper testing and quality control, target any code change pull requests against `dev` branch.
* Code changes go to the `development` branch first
* To ensure proper testing and quality control, target any code change pull requests against `development` branch.

* Make sure the tests pass
* Take a look at [TESTING.md](test/TESTING.md) to see how to run tests locally so you do not have to push all your code to a PR and have GitHub Actions run it.
Expand Down
Loading

0 comments on commit c38a6ea

Please sign in to comment.