Docker Build #66
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
name: Docker Build | |
on: | |
schedule: | |
- cron: '27 7 * * *' | |
push: | |
branches: [ "main" ] | |
paths: | |
- '.github/actions/**' | |
- .github/workflows/docker-images.yml | |
workflow_dispatch: | |
inputs: | |
magentoVersion: | |
description: 'Magento Version to limit execution to' | |
required: false | |
default: '2.4.6-p2' | |
magentoVariation: | |
description: 'Magento Variation to limit execution to' | |
required: false | |
default: default | |
jobs: | |
generate-matrix: | |
runs-on: ubuntu-24.04 | |
outputs: | |
magento: ${{ steps.matrix.outputs.magento }} | |
containers: ${{ steps.matrix.outputs.containers }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/generate-matrix | |
id: matrix | |
with: | |
version: ${{ inputs.magentoVersion }} | |
variation: ${{ inputs.magentoVariation }} | |
build-magento: | |
runs-on: ubuntu-24.04 | |
needs: generate-matrix | |
strategy: | |
matrix: | |
include: ${{ fromJson(needs.generate-matrix.outputs.magento) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/build-magento | |
with: | |
artifact: ${{ matrix.artifact }} | |
mariadb: ${{ matrix.mariadb }} | |
opensearch: ${{ matrix.opensearch }} | |
php: ${{ matrix.php }} | |
version: ${{ matrix.magentoVersion }} | |
kind: ${{ matrix.kind }} | |
stability: ${{ matrix.stability }} | |
composerAuth: ${{ secrets.COMPOSER_AUTH }} | |
composerRepository: 'https://repo.magento.com/' | |
id: build | |
build-container: | |
runs-on: ubuntu-24.04 | |
needs: [generate-matrix, build-magento] | |
continue-on-error: ${{ contains(matrix.artifact, 'beta') || contains(matrix.artifact, 'alpha') }} | |
permissions: | |
packages: write | |
contents: read | |
attestations: write | |
id-token: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: ${{ fromJson(needs.generate-matrix.outputs.containers) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build linux/amd64 and linux/arm64 version of Docker image | |
uses: ./.github/actions/build-image | |
with: | |
artifact: ${{ matrix.artifact }} | |
containerType: ${{ matrix.containerType }} | |
imageName: ${{ github.repository }}/${{ matrix.containerType }} | |
imageTags: ${{ matrix.tag }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
version: ${{ matrix.version }} | |
push: ${{ github.event_name != 'pull_request' }} | |
platforms: 'linux/amd64,linux/arm64' |