diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index dc497c1..c4a98d3 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -7,10 +7,12 @@ on: jobs: build: runs-on: ubuntu-latest + strategy: matrix: php_version: ['8.3', '8.1', '8.0', '7.4'] variant: ['apache', 'apache-chrome'] + steps: - name: Checkout Code uses: actions/checkout@v3 @@ -24,7 +26,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Set names + - name: Set variables run: | if [ "${{ matrix.variant }}" == "apache" ]; then echo "DOCKER_TAG=${{ matrix.php_version }}" >> $GITHUB_ENV @@ -36,6 +38,7 @@ jobs: echo "Invalid variant: ${{ matrix.variant }}" exit 1 fi + - name: Github Short SHA run: | echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV @@ -46,17 +49,8 @@ jobs: context: . file: ./${{ matrix.php_version }}/${{ env.DOCKER_FILE }} tags: - ghcr.io/${{ github.repository }}/php-apache-core:${{ env.DOCKER_TAG }} - ghcr.io/${{ github.repository }}/php-apache-core:${{ env.GITHUB_SHA_SHORT }} - push: true - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . + ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }} + ghcr.io/${{ github.repository }}:${{ env.GITHUB_SHA_SHORT }} push: true - tags: - ghcr.io/${{ github.repository }}:latest, - ghcr.io/${{ github.repository }}:${{ github.sha }} cache-from: type=gha cache-to: type=gha,mode=max