-
Notifications
You must be signed in to change notification settings - Fork 5
90 lines (88 loc) · 3.92 KB
/
build-root-images.yaml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: build-root-images
on:
workflow_dispatch: {}
schedule:
- cron: "0 0 * * 0"
env:
IMAGE_NAME: typo3
jobs:
build:
strategy:
fail-fast: false
matrix:
typo3:
- "11.5"
php:
- "8.1"
- "8.2"
include:
- typo3: "11.5"
php: "8.2"
latest: true
latest_php: true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Get full TYPO3 version
run: |
MAJOR_VERSION=$(echo ${{ matrix.typo3 }} | cut -d. -f1)
FULL_VERSION=$(curl https://get.typo3.org/json -s | jq -r ".[\"$MAJOR_VERSION\"].stable")
echo "FULL_VERSION=$FULL_VERSION" >> $GITHUB_ENV
echo "MAJOR_VERSION=$MAJOR_VERSION" >> $GITHUB_ENV
- name: Build and push with older php version
uses: docker/build-push-action@v4
if: matrix.latest != true && matrix.latest_php != true
with:
context: ${{ matrix.typo3 }}/
file: ${{ matrix.typo3 }}/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ matrix.typo3 }}-php${{ matrix.php }}-apache
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.MAJOR_VERSION }}-php${{ matrix.php }}-apache
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.FULL_VERSION }}-php${{ matrix.php }}-apache
build-args: |
BASE_IMAGE_TAG=${{ matrix.php }}-apache
TYPO3_VERSION=${{ env.FULL_VERSION }}
- name: Build and push latest with latest php version
uses: docker/build-push-action@v4
if: matrix.latest != true && matrix.latest_php == true
with:
context: ${{ matrix.typo3 }}/
file: ${{ matrix.typo3 }}/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ matrix.typo3 }}-php${{ matrix.php }}-apache
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.MAJOR_VERSION }}-php${{ matrix.php }}-apache
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.FULL_VERSION }}-php${{ matrix.php }}-apache
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ matrix.typo3 }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.MAJOR_VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.FULL_VERSION }}
build-args: |
BASE_IMAGE_TAG=${{ matrix.php }}-apache
TYPO3_VERSION=${{ env.FULL_VERSION }}
- name: Build and push latest
uses: docker/build-push-action@v4
if: matrix.latest == true
with:
context: ${{ matrix.typo3 }}/
file: ${{ matrix.typo3 }}/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ matrix.typo3 }}-php${{ matrix.php }}-apache
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.MAJOR_VERSION }}-php${{ matrix.php }}-apache
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.FULL_VERSION }}-php${{ matrix.php }}-apache
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ matrix.typo3 }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.MAJOR_VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.FULL_VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
build-args: |
BASE_IMAGE_TAG=${{ matrix.php }}-apache
TYPO3_VERSION=${{ env.FULL_VERSION }}