Skip to content

Add php-ssh image

Add php-ssh image #7

Workflow file for this run

name: build
on:
push:
branches:
- 1.x
paths:
- 'src/**'
schedule:
- cron: '25 4 * * *'
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
php: [ '7.4', '8.0', '8.1', '8.2']
target: [ 'cli', 'fpm', 'nginx', 'ssh' ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get branch name
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: ./src
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/sitepilot/php-${{ matrix.target }}:${{ env.BRANCH }}-${{ matrix.php }}
platforms: linux/amd64, linux/arm64
target: ${{ matrix.target }}
provenance: false
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
PHP_VERSION=${{ matrix.php }}