Add a workflow to build v6-pre-alpha container nightly/on push to that branch
This commit is contained in:
parent
99350c2327
commit
94a6ed33c5
|
@ -0,0 +1,65 @@
|
||||||
|
name: Build & Publish
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 5 * * *'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- v6-pre-alpha
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
if: github.event_name != 'schedule'
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Checkout dev branch if we are building
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: v6-pre-alpha
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
-
|
||||||
|
name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
images: |
|
||||||
|
${{ secrets.DOCKERHUB_NAMESPACE }}/pihole
|
||||||
|
ghcr.io/${{ github.repository_owner }}/pihole
|
||||||
|
flavor: |
|
||||||
|
latest=false
|
||||||
|
tags: |
|
||||||
|
v6-pre-alpha
|
||||||
|
-
|
||||||
|
name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USER }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASS }}
|
||||||
|
-
|
||||||
|
name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
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
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
Loading…
Reference in New Issue