Skip to content

Build

Build #175

Workflow file for this run

name: Build
on:
schedule:
- cron: '5 0 * * *'
workflow_dispatch:
push:
branches:
- main
paths:
- Dockerfile.php
env:
DOCKER_BUILDKIT: 1
permissions:
contents: read
packages: write
id-token: write
jobs:
base-slim:
name: "Build Base Slim"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Cache
uses: actions/cache@v4
id: cache
with:
key: wolfi-apk-cache
save-always: true
path: |
var-cache-apk-arm64
var-cache-apk-amd64
- name: Inject cache into docker
uses: reproducible-containers/buildkit-cache-dance@v3
with:
cache-map: |
{
"var-cache-apk-arm64": {
"target": "/var/cache/apk",
"id": "apk-arm64"
},
"var-cache-apk-amd64": {
"target": "/var/cache/apk",
"id": "apk-amd64"
}
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Build and push
uses: docker/bake-action@v5
with:
push: true
targets: base-slim
base-full:
name: "Build Base Full"
needs:
- base-slim
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache
uses: actions/cache@v4
id: cache
with:
key: wolfi-apk-cache-full
save-always: true
path: |
var-cache-apk-arm64
var-cache-apk-amd64
- name: Inject cache into docker
uses: reproducible-containers/buildkit-cache-dance@v3
with:
cache-map: |
{
"var-cache-apk-arm64": {
"target": "/var/cache/apk",
"id": "apk-arm64"
},
"var-cache-apk-amd64": {
"target": "/var/cache/apk",
"id": "apk-amd64"
}
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and push
uses: docker/bake-action@v5
with:
push: true
targets: base-full
generate-matrix:
name: "Generate Matrix"
needs:
- base-full
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate Matrix
id: generate-matrix
run: |
MATRIX=$(node matrix.mjs)
echo "matrix<<EOF" >> $GITHUB_OUTPUT
echo "$MATRIX" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
build-flex:
name: "Flex ${{ matrix.swVersion }} / PHP ${{ matrix.phpVersion }}"
runs-on: ubuntu-latest
needs:
- base-full
- generate-matrix
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and Push
uses: docker/bake-action@v5
with:
push: true
targets: symfony-flex
env:
currentPHPVersion: ${{ matrix.phpVersion }}
currentShopwareVersion: ${{ matrix.swVersion }}
build-dev:
name: "Dev ${{ matrix.swVersion }} / PHP ${{ matrix.phpVersion }}"
runs-on: ubuntu-latest
needs:
- base-full
- generate-matrix
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and Push
uses: docker/bake-action@v5
with:
push: true
targets: dev
env:
currentPHPVersion: ${{ matrix.phpVersion }}
currentShopwareVersion: ${{ matrix.swVersion }}