-
Notifications
You must be signed in to change notification settings - Fork 5
43 lines (39 loc) · 1.34 KB
/
docker-image.yml
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
42
43
name: Build Docker Image
on:
schedule:
- cron: '0 1 * * 0'
push:
tags: [ 'v*.*.*' ]
env:
PHP_EXTENSION_INSTALL_VERSION: 'latest'
COMPOSER_VERSION: 'latest'
jobs:
build:
name: Build PHP ${{ matrix.php-version }}
runs-on: ${{ matrix.os }}
env:
PHP_CLI_VERSION: ${{ matrix.php-version }}-cli-alpine
strategy:
matrix:
os: [ ubuntu-latest ]
php-version: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
max-parallel: 8
steps:
- name: Login to Docker Hub
# https://github.com/docker/login-action#docker-hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }}
- name: Build and push
# https://github.com/docker/build-push-action
uses: docker/build-push-action@v4
with:
build-args: |
PHP_CLI_VERSION=${{ env.PHP_CLI_VERSION }}
PHP_EXTENSION_INSTALL_VERSION=${{ env.PHP_EXTENSION_INSTALL_VERSION }}
COMPOSER_VERSION=${{ env.COMPOSER_VERSION }}
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/docker-webman:${{ env.PHP_CLI_VERSION }}
${{ secrets.DOCKER_USERNAME }}/docker-webman:${{ env.PHP_CLI_VERSION }}${{ github.ref_type == 'tag' && format('-{0}', github.ref_name) || '' }}