76 lines
2.2 KiB
YAML
76 lines
2.2 KiB
YAML
name: Build & Deploy custom image manually
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
name:
|
|
description: 'Name of tag'
|
|
required: true
|
|
core:
|
|
description: 'Branch or tag of core repo'
|
|
required: false
|
|
web:
|
|
description: 'Branch or tag of web repo'
|
|
required: false
|
|
ftl:
|
|
description: 'Branch or tag of ftl repo'
|
|
required: false
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
ARCH: amd64
|
|
DEBIAN_VERSION: buster
|
|
CORE_VERSION: ${{ github.event.inputs.core }}
|
|
WEB_VERSION: ${{ github.event.inputs.web }}
|
|
FTL_VERSION: ${{ github.event.inputs.ftl }}
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v2
|
|
- name: Run Tests
|
|
run: |
|
|
echo "Building ${ARCH}-${DEBIAN_VERSION}"
|
|
./gh-actions-test.sh
|
|
|
|
build-and-publish:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
-
|
|
name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USER }}
|
|
password: ${{ secrets.DOCKERHUB_PASS }}
|
|
-
|
|
name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64, linux/arm64, linux/386, linux/arm/v7, linux/arm/v6, linux/ppc64le
|
|
build-args: |
|
|
CORE_VERSION=${{ github.event.inputs.core }}
|
|
WEB_VERSION=${{ github.event.inputs.web }}
|
|
FTL_VERSION=${{ github.event.inputs.ftl }}
|
|
PIHOLE_VERSION=${{ github.event.inputs.name }}
|
|
push: true
|
|
tags: |
|
|
${{ secrets.DOCKERHUB_NAMESPACE }}/pihole:${{ github.event.inputs.name }}
|
|
ghcr.io/${{ github.repository_owner }}/pihole:${{ github.event.inputs.name }}
|