-
Notifications
You must be signed in to change notification settings - Fork 33
45 lines (41 loc) · 1.4 KB
/
docker.yml
File metadata and controls
45 lines (41 loc) · 1.4 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
name: docker-build
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
env:
FOLDER: template
OLS_VERSION: 1.9.0
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
PHP_VERSION: [lsphp82,lsphp83,lsphp84,lsphp85]
TAG: [latest,'']
steps:
- uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker build and push
if: ${{ (github.ref == 'refs/heads/master' && github.event_name == 'push') || (github.event_name == 'workflow_dispatch') }}
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
cd ${{ env.FOLDER }}
bash build.sh --ols ${{ env.OLS_VERSION }} --php ${{ matrix.PHP_VERSION }} --arch 'linux/amd64,linux/arm64' --tag "${{ matrix.TAG }}" --push
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker build
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'pull_request' }}
run: |
cd ${{ env.FOLDER }}
bash build.sh --ols ${{ env.OLS_VERSION }} --php ${{ matrix.PHP_VERSION }} --arch 'linux/amd64,linux/arm64' --tag ${{ matrix.TAG }}