forked from elcweb/docker-php
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.07 KB
/
Copy pathbuild.yml
File metadata and controls
41 lines (35 loc) · 1.07 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
36
37
38
39
40
41
name: Docker-Build
on:
push:
branches: [ main ]
tags:
- '*'
schedule:
- cron: "0 0 * * 0" # every week
jobs:
build:
strategy:
matrix:
flavor: [ apache, cli, fpm ]
php_version: [ '7.4', '8.0', '8.1', '8.2' ]
runs-on: ubuntu-latest
env:
DOCKER_IMAGE: elcweb/php:${{ matrix.php_version }}
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0
- name: Login to DockerHub
uses: docker/login-action@v2.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build PHP ${{ matrix.php_version }} - ${{ matrix.flavor }}
id: docker_build
uses: docker/build-push-action@v3
with:
push: true
context: ./${{ matrix.php_version }}/${{ matrix.flavor }}
tags: ${{ env.DOCKER_IMAGE }}-${{ matrix.flavor }}
cache-from: type=registry,ref=${{ env.DOCKER_IMAGE }}-${{ matrix.flavor }}
cache-to: type=inline