Skip to content

Commit

Permalink
Merge pull request #9 from rlabinc/main
Browse files Browse the repository at this point in the history
Combine "latest" & "dev" folders
  • Loading branch information
origamiofficial authored Aug 28, 2023
2 parents d3c47a9 + f8c3b05 commit 1ae77f0
Show file tree
Hide file tree
Showing 19 changed files with 18 additions and 560 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build-and-push-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Dev Build & Push
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *'

Expand All @@ -20,7 +21,7 @@ jobs:
id: base_update_check
run: |
BASE_IMAGE_DIGEST=$(curl -s https://registry.hub.docker.com/v2/repositories/pihole/pihole/tags/dev | grep -oP '"digest":"\K[^"]+' | tail -1)
PREVIOUS_DIGEST=$(cat ./dev/Base_Digest)
PREVIOUS_DIGEST=$(cat ./Dev_Base_Digest)
if [ "$BASE_IMAGE_DIGEST" == "$PREVIOUS_DIGEST" ]; then
echo "Base image has not been updated. Exiting..."
echo "build_image=false" >> $GITHUB_OUTPUT
Expand All @@ -36,7 +37,6 @@ jobs:
steps:
-
name: Checkout
if: github.event_name == 'schedule'
uses: actions/checkout@v3
with:
ref: main
Expand Down Expand Up @@ -67,8 +67,9 @@ jobs:
name: Build and push
uses: docker/build-push-action@v4
with:
context: ./dev/
context: ./
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6
build-args: BASE_IMG_TAG=dev
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -82,7 +83,7 @@ jobs:
run: |
BASE_IMAGE_DIGEST=$(curl -s https://registry.hub.docker.com/v2/repositories/pihole/pihole/tags/dev | grep -oP '"digest":"\K[^"]+' | tail -1)
echo "New Digest: $BASE_IMAGE_DIGEST"
echo $BASE_IMAGE_DIGEST > ./dev/Base_Digest
echo $BASE_IMAGE_DIGEST > ./Dev_Base_Digest
-
name: Push changes to repository
env:
Expand All @@ -94,6 +95,6 @@ jobs:
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/origamiofficial/docker-pihole-unbound.git
git add ./dev/Base_Digest
git add ./Dev_Base_Digest
git commit -m "Base Digest Updated"
git push
10 changes: 5 additions & 5 deletions .github/workflows/build-and-push-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
id: base_update_check
run: |
BASE_IMAGE_DIGEST=$(curl -s https://registry.hub.docker.com/v2/repositories/pihole/pihole/tags/latest | grep -oP '"digest":"\K[^"]+' | tail -1)
PREVIOUS_DIGEST=$(cat ./latest/Base_Digest)
PREVIOUS_DIGEST=$(cat ./Latest_Base_Digest)
if [ "$BASE_IMAGE_DIGEST" == "$PREVIOUS_DIGEST" ]; then
echo "Base image has not been updated. Exiting..."
echo "build_image=false" >> $GITHUB_OUTPUT
Expand All @@ -36,7 +36,6 @@ jobs:
steps:
-
name: Checkout
if: github.event_name == 'schedule'
uses: actions/checkout@v3
with:
ref: main
Expand Down Expand Up @@ -67,8 +66,9 @@ jobs:
name: Build and push
uses: docker/build-push-action@v4
with:
context: ./latest/
context: ./
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6
build-args: BASE_IMG_TAG=latest
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -82,7 +82,7 @@ jobs:
run: |
BASE_IMAGE_DIGEST=$(curl -s https://registry.hub.docker.com/v2/repositories/pihole/pihole/tags/latest | grep -oP '"digest":"\K[^"]+' | tail -1)
echo "New Digest: $BASE_IMAGE_DIGEST"
echo $BASE_IMAGE_DIGEST > ./latest/Base_Digest
echo $BASE_IMAGE_DIGEST > ./Latest_Base_Digest
-
name: Push changes to repository
env:
Expand All @@ -94,6 +94,6 @@ jobs:
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/origamiofficial/docker-pihole-unbound.git
git add ./latest/Base_Digest
git add ./Latest_Base_Digest
git commit -m "Base Digest Updated"
git push
File renamed without changes.
1 change: 1 addition & 0 deletions Dev_Base_Digest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TEST-DEV-BASE-DIGEST
9 changes: 6 additions & 3 deletions dev/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM pihole/pihole:dev as openssl
# Define an ARG for the base image tag
ARG BASE_IMG_TAG=none

FROM pihole/pihole:${BASE_IMG_TAG} as openssl

WORKDIR /tmp/src

Expand Down Expand Up @@ -27,7 +30,7 @@ RUN set -e -x && \
/var/lib/apt/lists/*


FROM pihole/pihole:dev as unbound
FROM pihole/pihole:${BASE_IMG_TAG} as unbound

WORKDIR /tmp/src

Expand Down Expand Up @@ -72,7 +75,7 @@ RUN build_deps="curl gcc libc-dev libevent-dev libexpat1-dev libnghttp2-dev make
/var/lib/apt/lists/*


FROM pihole/pihole:dev
FROM pihole/pihole:${BASE_IMG_TAG}

WORKDIR /tmp/src

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion dev/Base_Digest

This file was deleted.

1 change: 0 additions & 1 deletion latest/99-edns.conf

This file was deleted.

116 changes: 0 additions & 116 deletions latest/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions latest/data/opt/unbound/etc/unbound/a-records.conf

This file was deleted.

48 changes: 0 additions & 48 deletions latest/data/opt/unbound/etc/unbound/forward-records.conf

This file was deleted.

2 changes: 0 additions & 2 deletions latest/data/opt/unbound/etc/unbound/srv-records.conf

This file was deleted.

Loading

0 comments on commit 1ae77f0

Please sign in to comment.