-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (70 loc) · 2.2 KB
/
build.yml
File metadata and controls
72 lines (70 loc) · 2.2 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Build image and push to Docker Hub
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
version: ['base', 'mssql', 'xdebug', 'mssql-xdebug']
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.ref_name }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Create tag name
id: build-tag
run: |
if [[ ${{ matrix.version }} == 'base' ]]; then
echo "::set-output name=tag::"
else
echo "::set-output name=tag::-${{ matrix.version }}"
fi
-
name: Build latest
if: ${{ github.ref_name == '8.3' && matrix.version == 'base' }}
uses: docker/build-push-action@v6
with:
context: ./base
push: true
platforms: ${{ secrets.DOCKER_PLATFORMS }}
tags: rshop/php:latest
-
name: Build ${{ matrix.version }}
uses: docker/build-push-action@v6
with:
context: ./${{ matrix.version }}
push: true
platforms: ${{ secrets.DOCKER_PLATFORMS }}
tags: rshop/php:${{ github.ref_name }}${{ steps.build-tag.outputs.tag }}
-
name: Trigger apache ${{ matrix.version }} rebuild
uses: rshop/trigger-workflow-action@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
repository: 'rshop/docker-php-apache'
branch: ${{ github.ref_name }}${{ steps.build-tag.outputs.tag }}
-
name: Trigger swoole ${{ matrix.version }} rebuild
if: ${{ !contains(matrix.version, 'xdebug') }}
uses: rshop/trigger-workflow-action@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
repository: 'rshop/docker-swoole'
branch: ${{ github.ref_name }}${{ steps.build-tag.outputs.tag }}