73 lines
2.0 KiB
YAML
73 lines
2.0 KiB
YAML
name: Build & Deploy custom image manually
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
branch:
|
|
description: "Name of Branch to base build on"
|
|
required: false
|
|
default: dev
|
|
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
|
|
with:
|
|
ref: ${{ github.event.inputs.branch }}
|
|
- 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: Build and push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64,linux/i386,linux/arm/v7
|
|
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: |
|
|
pihole/pihole:${{ github.event.inputs.name }} |