-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (35 loc) · 1.02 KB
/
Copy pathdocker-image.yml
File metadata and controls
35 lines (35 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: "Docker build and push"
on:
push:
paths:
- php/**
jobs:
build_push_images:
runs-on: ubuntu-latest
strategy:
fail-fast: true
max-parallel: 4
matrix:
version: [ 8.3,8.4, 8.5 ]
sapi: [ cli, fpm ]
env: [ dev,prod ]
variant: [ alpine ]
steps:
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push
uses: docker/build-push-action@v7
with:
context: ./php/${{ matrix.variant }}
push: true
tags: ${{ github.repository_owner }}/php:${{ matrix.version }}-${{ matrix.sapi }}-${{ matrix.variant }}-${{ matrix.env }}
build-args: |
PHP_VERSION=${{ matrix.version }}
SAPI=${{ matrix.sapi }}