-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1bee22c
commit b89c0ea
Showing
3 changed files
with
130 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
image: | ||
required: true | ||
type: string | ||
context: | ||
required: true | ||
type: string | ||
dockerfile: | ||
required: false | ||
type: string | ||
default: 'Dockerfile' | ||
multiarch: | ||
required: false | ||
type: boolean | ||
default: true | ||
|
||
jobs: | ||
build-image: | ||
name: Build ${{ inputs.image }} image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
fetch-depth: 1 | ||
- name: Log in to Docker Hub | ||
uses: docker/#-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 | ||
with: | ||
images: totara/docker-dev-${{ inputs.image }} | ||
# Adds tags for 'x.x.x' release version and 'multiarch' if multiarch | ||
tags: | | ||
type=semver,pattern={{version}} | ||
${{ inputs.multiarch == true && 'type=raw,multiarch' || '' }} | ||
- name: Set up QEMU (to support building for both amd64 and arm64) | ||
if: ${{ inputs.multiarch == true }} | ||
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 | ||
with: | ||
platforms: ${{ inputs.multiarch == true && 'linux/amd64,linux/arm64' || 'linux/amd64' }} | ||
- name: Build and push images | ||
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 | ||
with: | ||
context: ${{ inputs.context }} | ||
file: ${{ inputs.context }}/${{ inputs.dockerfile }} | ||
push: true | ||
platforms: ${{ inputs.multiarch == true && 'linux/amd64,linux/arm64' || 'linux/amd64' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Build docker-dev images upon a new release | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
build-apache-image: | ||
name: Build Apache image | ||
uses: ./.github/workflows/build-image.yml | ||
with: | ||
image: apache | ||
context: ./apache | ||
secrets: inherit | ||
|
||
build-nginx-image: | ||
name: Build Nginx image | ||
uses: ./.github/workflows/build-image.yml | ||
with: | ||
image: nginx | ||
context: ./nginx | ||
secrets: inherit | ||
|
||
build-mssql-images: | ||
name: Build MSSQL images | ||
strategy: | ||
matrix: | ||
version: [2017, 2019, 2022] | ||
uses: ./.github/workflows/build-image.yml | ||
with: | ||
image: mssql${{ matrix.version }} | ||
context: ./mssql | ||
dockerfile: ${{ matrix.version }}/Dockerfile | ||
multiarch: false # Mssql does not support multiple architectures | ||
secrets: inherit | ||
|
||
build-php-images: | ||
name: Build PHP base images | ||
strategy: | ||
matrix: | ||
version: [53, 54, 55, 56, 70, 71, 72, 73, 80, 81, 82, 83] | ||
uses: ./.github/workflows/build-image.yml | ||
with: | ||
image: php${{ matrix.version }} | ||
context: ./php/php${{ matrix.version }} | ||
secrets: inherit | ||
|
||
build-php-debug-images: | ||
name: Build PHP debug images | ||
needs: build-php-images | ||
strategy: | ||
matrix: | ||
version: [53, 54, 55, 56, 70, 71, 72, 73, 80, 81, 82, 83] | ||
uses: ./.github/workflows/build-image.yml | ||
with: | ||
image: php${{ matrix.version }}-debug | ||
context: ./php/php${{ matrix.version }}-debug | ||
secrets: inherit | ||
|
||
build-php-cron-images: | ||
name: Build PHP cron images | ||
needs: build-php-images | ||
strategy: | ||
matrix: | ||
# Note: no cron container for v5.3 | ||
version: [54, 55, 56, 70, 71, 72, 73, 80, 81, 82, 83] | ||
uses: ./.github/workflows/build-image.yml | ||
with: | ||
image: php${{ matrix.version }}-cron | ||
context: ./php/php${{ matrix.version }}-cron | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters