Test Build on GH
This commit is contained in:
53
.github/workflows/build.yml
vendored
Normal file
53
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: Docker Build and Publish for caddy-crowdsec
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- caddy-cloudflare/Dockerfile
|
||||
|
||||
env:
|
||||
DOCKERHUB_REPO: caddy-crowdsec
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
repo: [caddy-cloudflare,caddy-cloudflare-crowdsec,caddy-cloudflare-ddns,caddy-cloudflare-ddns-crowdsec,caddy-crowdsec]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Parse Caddy version
|
||||
id: version
|
||||
run: echo "VERSION=$(grep -Eo 'caddy:[0-9]+\.[0-9]+\.[0-9]+$' ${{matrix.repo}}/Dockerfile | cut -d ':' -f2)" >> $GITHUB_ENV
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Build and Push Docker images for all Container Registries
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
tags: ryuupendragon/${{matrix.repo}}:${{ env.VERSION }}, ryuupendragon/${{matrix.repo}}:latest, ghcr.io/ryuupendragon/${{matrix.repo}}:${{ env.VERSION }}, ghcr.io/ryuupendragon/${{matrix.repo}}:latest
|
||||
file: ${{matrix.repo}}/Dockerfile
|
||||
platform: linux/amd64,linux/arm64
|
||||
push: true
|
Reference in New Issue
Block a user