From fa5344e16c73f5e7b7af5ecda3cf5a48869f37c2 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 2 Sep 2024 22:05:41 +0100 Subject: [PATCH 1/2] remove old build scripts from master (we wont use them again) and bring accross the v6 one so that the nightly image is built using the correct branches Signed-off-by: Adam Warner --- ...and-build-v6.yml => build-and-publish.yml} | 40 +++++++-- .github/workflows/test-and-build.yaml | 84 ------------------- 2 files changed, 31 insertions(+), 93 deletions(-) rename .github/workflows/{test-and-build-v6.yml => build-and-publish.yml} (77%) delete mode 100644 .github/workflows/test-and-build.yaml diff --git a/.github/workflows/test-and-build-v6.yml b/.github/workflows/build-and-publish.yml similarity index 77% rename from .github/workflows/test-and-build-v6.yml rename to .github/workflows/build-and-publish.yml index 09d2ddeb..d8cf2ae7 100644 --- a/.github/workflows/test-and-build-v6.yml +++ b/.github/workflows/build-and-publish.yml @@ -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: @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/test-and-build.yaml b/.github/workflows/test-and-build.yaml deleted file mode 100644 index 34687732..00000000 --- a/.github/workflows/test-and-build.yaml +++ /dev/null @@ -1,84 +0,0 @@ -name: Test & Build -on: - schedule: - - cron: '0 2 * * *' - push: - branches: - - dev - pull_request: - release: - types: [published] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - name: Run Tests - run: | - echo "Building image to test" - ./build-and-test.sh - - build-and-publish: - if: github.event_name != 'pull_request' - # If only readme has been touched, for example, then the `test` job will have been skipped. This job will therefore be skipped, too. - needs: test - runs-on: ubuntu-latest - steps: - - - name: Checkout - if: github.event_name != 'schedule' - uses: actions/checkout@v4 - - - name: Checkout dev branch if we are building nightly - if: github.event_name == 'schedule' - uses: actions/checkout@v4 - with: - ref: dev - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - images: | - ${{ secrets.DOCKERHUB_NAMESPACE }}/pihole - ghcr.io/${{ github.repository_owner }}/pihole - flavor: | - latest=${{ startsWith(github.ref, 'refs/tags/') }} - tags: | - type=schedule - type=ref,event=branch,enable=${{ github.event_name != 'schedule' }} - type=ref,event=tag - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_PASS }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v6 - with: - context: ./src/ - platforms: linux/amd64, linux/arm64, linux/386, linux/arm/v7, linux/arm/v6 - build-args: | - PIHOLE_DOCKER_TAG=${{ steps.meta.outputs.version }} - push: true - provenance: false - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} From bd54136d085f660e72c6b1a8f60c5492dceca2c3 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 2 Sep 2024 22:09:55 +0100 Subject: [PATCH 2/2] update dependabot.yml to run against `development` not `dev` - remove v6 references Signed-off-by: Adam Warner --- .github/dependabot.yml | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a350cbfd..4f6e07c1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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" @@ -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 @@ -26,35 +26,6 @@ updates: day: saturday time: "10:00" open-pull-requests-limit: 10 - target-branch: dev - 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 + target-branch: development reviewers: - "pi-hole/docker-maintainers"