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 c1d5d9f commit 65d1fed
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Github Short SHA
run: |
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
- name: Set variables
run: |
if [ "${{ matrix.variant }}" == "apache" ]; then
Expand All @@ -39,13 +43,18 @@ jobs:
exit 1
fi
- name: Github Short SHA
- name: Check if file exists
id: check_file
run: |
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
if [ -f "./${{ matrix.php_version }}/${{ env.DOCKER_FILE }}" ]; then
echo "file_exists=true" >> $GITHUB_ENV
else
echo "file_exists=false" >> $GITHUB_ENV
fi
- name: Build and push
uses: docker/build-push-action@v5
if: matrix.php_version != '7.4' && matrix.variant != 'apache-chrome'
if: env.file_exists == 'true'
with:
context: .
file: ./${{ matrix.php_version }}/${{ env.DOCKER_FILE }}
Expand Down

0 comments on commit 65d1fed

Please sign in to comment.