- Replace PIHOLE_VERSION with PIHOLE_DOCKER_TAG

- reorder some stuff in the main Dockerfile
- Remove the CORE/WEB/FTL_VERSION args/env vars
- tweaks to GHA build script after some hints from @crazy-max
- always checkout dev versions of Pi-hole for nightly build, also make sure we're using dev branch of this repo
- keep pihole checkout enabled for dev and nightly tags

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner
2021-12-10 20:51:35 +00:00
parent 7049b5df03
commit 9a9ee41a45
9 changed files with 37 additions and 141 deletions

View File

@@ -9,7 +9,6 @@ on:
release:
types: [published]
jobs:
test:
runs-on: ubuntu-latest
@@ -31,26 +30,14 @@ jobs:
steps:
-
name: Checkout
if: github.event_name != 'schedule'
uses: actions/checkout@v2
-
name: Calculate the versions to use
id: variables
run: |
# If trigged by schedule then container tag will be nightly, else it's either dev or whatever the tagged version number is
PIHOLE_VERSION=$([ "${{ github.event_name == 'schedule' }}" = "true" ] && echo "nightly" || echo "${GITHUB_REF#refs/*/}")
# If we are building dev branch or nightly then we want to use the development branches of the core components
# otherwise they will be unset and the main branches will be pulled
if [ "${PIHOLE_VERSION}" = "dev" || "${PIHOLE_VERSION}" = "nightly" ]; then
CORE_VERSION=development
WEB_VERSION=devel
FTL_VERSION=development
fi
echo ::set-output name=CORE_VERSION::${CORE_VERSION}
echo ::set-output name=WEB_VERSION::${WEB_VERSION}
echo ::set-output name=FTL_VERSION::${FTL_VERSION}
echo ::set-output name=PIHOLE_VERSION::${PIHOLE_VERSION}
name: Checkout dev branch if we are building nightly
if: github.event_name == 'schedule'
uses: actions/checkout@v2
with:
ref: dev
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
@@ -69,7 +56,9 @@ jobs:
flavor: |
latest=${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
${{ steps.variables.outputs.PIHOLE_VERSION }}
type=schedule
type=ref,event=branch
type=ref,event=tag
-
name: Login to DockerHub
uses: docker/login-action@v1
@@ -90,10 +79,7 @@ jobs:
context: .
platforms: linux/amd64, linux/arm64, linux/386, linux/arm/v7, linux/arm/v6, linux/ppc64le
build-args: |
CORE_VERSION=${{ steps.variables.outputs.CORE_VERSION }}
WEB_VERSION=${{ steps.variables.outputs.WEB_VERSION }}
FTL_VERSION=${{ steps.variables.outputs.FTL_VERSION }}
PIHOLE_VERSION=${{ steps.variables.outputs.PIHOLE_VERSION }}
PIHOLE_DOCKER_TAG=${{ steps.meta.outputs.version }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}