Skip to content

Merge pull request #192 from stellarwp/1.6.2 #114

Merge pull request #192 from stellarwp/1.6.2

Merge pull request #192 from stellarwp/1.6.2 #114

name: Publish slic-php docker image
on:
push:
branches:
- main
- '[0-9]+.[0-9]+.[0-9]+'
release:
types: [published]
jobs:
publish-slic-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
# The php_version is the docker tag from https://hub.docker.com/_/php/tags
include:
- image_suffix: '7.3'
php_version: '7.3.33'
- image_suffix: '7.4'
php_version: '7.4.33'
- image_suffix: '8.0'
php_version: '8.0.28'
- image_suffix: '8.1'
php_version: '8.1.16'
- image_suffix: '8.2'
php_version: '8.2.3'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for image
id: meta
uses: docker/metadata-action@v4.3.0
with:
images: ghcr.io/${{ github.repository }}-php${{ matrix.image_suffix }}
tags: |
type=edge,branch=main
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{raw}}
- uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v3.3.1
with:
context: containers/slic
file: containers/slic/Dockerfile
push: true
tags: |
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.php_version }}
cache-to: type=gha,mode=max,scope=${{ matrix.php_version }}
build-args: |
PHP_VERSION=${{ matrix.php_version }}
NODE_VERSION=18.13.0
NVM_VERSION=v0.39.7
platforms: linux/amd64,linux/arm64