Skip to content

Commit

Permalink
Switch to composite workflow for building images
Browse files Browse the repository at this point in the history
  • Loading branch information
rnijveld committed May 29, 2024
1 parent a2d71fb commit c9f0882
Showing 1 changed file with 33 additions and 27 deletions.
60 changes: 33 additions & 27 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,47 @@ on:
type: string

jobs:
base:
uses: "tweedegolf/actions-helpers/.github/workflows/container-image.yml@main"
with:
context: "${{ inputs.php_version }}"
file: "${{ inputs.php_version }}/Dockerfile"
push: ${{ github.ref == 'refs/heads/main' }}
platforms: "linux/amd64,linux/arm64"
build-args: |
build-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Build the base image
uses: tweedegolf/build-container-image@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
context: "${{ inputs.php_version }}"
file: "${{ inputs.php_version }}/Dockerfile"
push: ${{ github.ref == 'refs/heads/main' }}
platforms: "linux/amd64,linux/arm64"
build-args: |
DEBIAN_VERSION=${{ inputs.debian_version }}
POSTGRESQL_VERSION=${{ inputs.postgresql_version }}
COMPOSER_VERSION=${{ inputs.composer_version }}
tags: |
tags: |
ghcr.io/tweedegolf/php:${{inputs.php_version}}
${{ inputs.latest && 'ghcr.io/tweedegolf/php:latest' || '' }}
dev:
needs: [base]
uses: "tweedegolf/actions-helpers/.github/workflows/container-image.yml@main"
with:
context: "${{ inputs.php_version }}"
file: "${{ inputs.php_version }}/Dockerfile.dev"
push: ${{ github.ref == 'refs/heads/main' }}
platforms: "linux/amd64,linux/arm64"
tags: |
- name: Build the development image
uses: tweedegolf/build-container-image@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
context: "${{ inputs.php_version }}"
file: "${{ inputs.php_version }}/Dockerfile.dev"
push: ${{ github.ref == 'refs/heads/main' }}
platforms: "linux/amd64,linux/arm64"
tags: |
ghcr.io/tweedegolf/php:${{inputs.php_version}}-dev
${{ inputs.latest && 'ghcr.io/tweedegolf/php:latest-dev' || '' }}
debug:
needs: [dev]
uses: "tweedegolf/actions-helpers/.github/workflows/container-image.yml@main"
with:
context: "${{ inputs.php_version }}"
file: "${{ inputs.php_version }}/Dockerfile.debug"
push: ${{ github.ref == 'refs/heads/main' }}
platforms: "linux/amd64,linux/arm64"
tags: |
- name: Build the debugging image
uses: tweedegolf/build-container-image@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
context: "${{ inputs.php_version }}"
file: "${{ inputs.php_version }}/Dockerfile.debug"
push: ${{ github.ref == 'refs/heads/main' }}
platforms: "linux/amd64,linux/arm64"
tags: |
ghcr.io/tweedegolf/php:${{inputs.php_version}}-debug
${{ inputs.latest && 'ghcr.io/tweedegolf/php:latest-debug' || '' }}

0 comments on commit c9f0882

Please sign in to comment.