Skip to content

feat: support for 8.3 php images #74

feat: support for 8.3 php images

feat: support for 8.3 php images #74

Workflow file for this run

---
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
branches:
- master
push:
branches:
- master
env:
DOCKER_NAMESPACE: wayofdev/php-base
GHCR_NAMESPACE: ghcr.io/wayofdev/php-base
name: 🚀 Build docker images with latest tag
jobs:
build:
strategy:
fail-fast: false
matrix:
os_name: ["alpine"]
php_version: ["8.1"]
php_type: ["fpm"]
builder: [{arch: "amd64", os: "ubuntu-latest"}]
runs-on: ${{ matrix.builder.os }}
steps:
- name: 🌎 Set environment variables
run: |

Check failure on line 34 in .github/workflows/build-latest.yml

View workflow run for this annotation

GitHub Actions / 🚀 Build docker images with latest tag

Invalid workflow file

The workflow is not valid. .github/workflows/build-latest.yml (Line: 34, Col: 14): Unexpected symbol: '//'. Located at position 20 within expression: matrix.php_version //./
tag=${{ matrix.php_version }}-${{ matrix.php_type }}-${{ matrix.os_name }}-${{ matrix.builder.arch }}
php_version_slug="${{ matrix.php_version //./ }}"
target="php-${php_version_slug}-${{ matrix.php_type }}-${{ matrix.os_name }}"
echo "TARGET=${target}" >> $GITHUB_ENV
echo "PLATFORM_CACHE_TAG=${tag}" >> $GITHUB_ENV
- name: 📦 Check out the codebase
uses: actions/checkout@v4
- name: 🤖 Generate dist files
run: ansible-playbook src/playbook.yml -l ${{ matrix.php_version }}-${{ matrix.php_type }}-${{ matrix.os_name }}
- name: 💻 Set up Docker for MacOS
if: ${{ matrix.builder.os == 'macos-latest' }}
uses: docker-practice/actions-setup-docker@master
- name: 🛠️ Setup docker QEMU
uses: docker/setup-qemu-action@v3
- name: 🛠️ Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: "--debug"
- name: 🔑 Login to docker-hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: 🔑 Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🚀 Bake image and push to docker-hub and GHCR
id: bake
uses: docker/bake-action@v3
with:
targets: ${{ env.TARGET }}
files: |
./docker-bake.hcl
set: |
*.tags=
*.platform=linux/${{ matrix.builder.arch }}
*.cache-from=type=gha,scope=build-${{ env.PLATFORM_CACHE_TAG }}
*.cache-to=type=gha,scope=build-${{ env.PLATFORM_CACHE_TAG }}
*.output=type=image,"name=${{ env.DOCKER_NAMESPACE }},${{ env.GHCR_NAMESPACE }}",push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
- name: 🔍 Debug Bake Metadata Output
run: |
echo "${{ steps.bake.outputs.metadata }}"
- name: 📥 Export digest
run: |
mkdir -p /tmp/digests
echo "Bake Metadata: ${{ steps.bake.outputs.metadata }}"
digest=$(echo '${{ steps.bake.outputs.metadata }}' | jq -r '.["${{ env.TARGET }}"]["containerimage.digest"]')
if [[ -z "$digest" || "$digest" == "null" ]]; then
echo "Digest not found."
exit 1
fi
echo "Digest: $digest"
touch "/tmp/digests/${digest#sha256:}"
- name: 📤 Upload digest
uses: actions/upload-artifact@v4
with:
name: digests
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
...