-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (99 loc) · 3.9 KB
/
test_and_build.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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Test and Build
on:
push:
branches:
- php8.1
- php8.2
pull_request:
branches:
- php8.1
- php8.2
repository_dispatch: # Allows action to be triggered via webhook
workflow_dispatch: # Allows action to be run manually from the Actions tab
jobs:
build-docker:
if: ${{ github.ref_name == 'php8.1' || github.base_ref == 'php8.1' || github.ref_name == 'php8.2' || github.base_ref == 'php8.2' }}
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build 8.1 Linux Image
if: ${{ github.event_name == 'pull_request' && (github.ref_name == 'php8.1' || github.base_ref == 'php8.1') }}
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7
tags: |
lan2play/docker-php-nginx-base:php8.1
lan2play/docker-php-nginx-base:v3
build-args: |
BUILDNODE=GitHub (Run Number: ${{ github.run_number }} Run ID: ${{ github.run_id }})
BUILDID=${{ github.run_id }}
BUILDNUMBER=${{ github.run_number }}
SOURCE_COMMIT=${{ github.sha }}
no-cache: true
push: false
- name: Build and push 8.1 Linux Image
if: ${{ github.event_name != 'pull_request' && (github.ref_name == 'php8.1' || github.base_ref == 'php8.1') }}
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7
tags: |
lan2play/docker-php-nginx-base:php8.1
lan2play/docker-php-nginx-base:v3
build-args: |
BUILDNODE=GitHub (Run Number: ${{ github.run_number }} Run ID: ${{ github.run_id }})
BUILDID=${{ github.run_id }}
BUILDNUMBER=${{ github.run_number }}
SOURCE_COMMIT=${{ github.sha }}
no-cache: true
push: true
- name: Build 8.2 Linux Image
if: ${{ github.event_name == 'pull_request' && (github.ref_name == 'php8.2' || github.base_ref == 'php8.2') }}
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7
tags: |
lan2play/docker-php-nginx-base:latest
lan2play/docker-php-nginx-base:php8.2
lan2play/docker-php-nginx-base:v4
build-args: |
BUILDNODE=GitHub (Run Number: ${{ github.run_number }} Run ID: ${{ github.run_id }})
BUILDID=${{ github.run_id }}
BUILDNUMBER=${{ github.run_number }}
SOURCE_COMMIT=${{ github.sha }}
no-cache: true
push: false
- name: Build and push 8.2 Linux Image
if: ${{ github.event_name != 'pull_request' && (github.ref_name == 'php8.2' || github.base_ref == 'php8.2') }}
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7
tags: |
lan2play/docker-php-nginx-base:latest
lan2play/docker-php-nginx-base:php8.2
lan2play/docker-php-nginx-base:v4
build-args: |
BUILDNODE=GitHub (Run Number: ${{ github.run_number }} Run ID: ${{ github.run_id }})
BUILDID=${{ github.run_id }}
BUILDNUMBER=${{ github.run_number }}
SOURCE_COMMIT=${{ github.sha }}
no-cache: true
push: true