Trying my luck with workflows again...

This commit is contained in:
EdyTheCow
2025-10-02 17:10:11 +02:00
parent f0eb9e3240
commit 3ffdfef208
4 changed files with 80 additions and 47 deletions

View File

@@ -0,0 +1,42 @@
name: Build & Push Docker Image Common
on:
workflow_call:
inputs:
context:
required: true
type: string
image_tag:
required: true
type: string
secrets:
GITHUB_TOKEN:
required: true
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & push image
uses: docker/build-push-action@v6
with:
context: ${{ inputs.context }}
push: true
tags: ${{ inputs.image_tag }}

19
.github/workflows/build-whmcs-nginx.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: Build WHMCS NGINX
on:
push:
branches: [ docker-images ]
paths:
- 'whmcs-nginx/**'
pull_request:
paths:
- 'whmcs-nginx/**'
jobs:
build:
uses: ./.github/workflows/build-image-common.yml
with:
context: whmcs-nginx
image_tag: ghcr.io/edythecow/whmcs-nginx:latest
secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,19 @@
name: Build WHMCS PHP-FPM
on:
push:
branches: [ docker-images ]
paths:
- 'whmcs-php-fpm/**'
pull_request:
paths:
- 'whmcs-php-fpm/**'
jobs:
build:
uses: ./.github/workflows/build-image-common.yml
with:
context: whmcs-php-fpm
image_tag: ghcr.io/edythecow/whmcs-php-fpm:latest
secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,47 +0,0 @@
name: Build and publish WHMCS Docker images
on:
push:
branches: [ docker-images ]
paths:
- 'whmcs-php-fpm/**'
- 'whmcs-nginx/**'
pull_request:
paths:
- 'whmcs-php-fpm/**'
- 'whmcs-nginx/**'
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # required to push to ghcr.io
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & push whmcs-php-fpm
uses: docker/build-push-action@v6
with:
context: whmcs-php-fpm/
push: true
tags: ghcr.io/edythecow/whmcs-php-fpm:latest
- name: Build & push whmcs-nginx
uses: docker/build-push-action@v6
with:
context: whmcs-nginx/
push: true
tags: ghcr.io/edythecow/whmcs-nginx:latest