-
Notifications
You must be signed in to change notification settings - Fork 34
59 lines (51 loc) · 1.92 KB
/
base-docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Update Base Docker Image
on:
workflow_dispatch:
push:
tags-ignore:
- "*"
paths:
- 'Dockerfile.base'
env:
DOCKER_BUILDKIT: 1
jobs:
build:
name: Build PHP ${{ matrix.php-version }} for ${{ matrix.arch }}
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'buildjet-2vcpu-ubuntu-2204-arm' }}
strategy:
matrix:
php-version: [ "8.2", "8.1"]
arch: [ "amd64", "arm64" ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login into Github Docker Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
file: Dockerfile.base
platforms: linux/${{ matrix.arch }}
tags: "ghcr.io/friendsofshopware/shopware-cli-base:${{ matrix.php-version }}-${{ matrix.arch }}"
build-args: |
PHP_VERSION=${{ matrix.php-version }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
merge:
name: Merge Image (${{ matrix.php-version }})
runs-on: ubuntu-latest
needs:
- build
strategy:
matrix:
php-version: ["8.2", "8.1"]
steps:
- name: Login into Github Docker Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- run: docker manifest create ghcr.io/friendsofshopware/shopware-cli-base:${{ matrix.php-version }} --amend ghcr.io/friendsofshopware/shopware-cli-base:${{ matrix.php-version }}-amd64 --amend ghcr.io/friendsofshopware/shopware-cli-base:${{ matrix.php-version }}-arm64
- run: docker manifest push ghcr.io/friendsofshopware/shopware-cli-base:${{ matrix.php-version }}