build-root-images #29
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: 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 }} |