Skip to content

Commit

Permalink
Update build-images.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nhalstead committed Jun 27, 2024
1 parent 336a538 commit 1ac5e33
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 1ac5e33

Please sign in to comment.