-
Notifications
You must be signed in to change notification settings - Fork 26
40 lines (35 loc) · 1.18 KB
/
docker.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
name: docker-build
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
env:
FOLDER: template
OLS_VERSION: 1.8.0
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
PHP_VERSION: [lsphp74, lsphp80, lsphp81, lsphp82]
TAG: [latest,'']
steps:
- uses: actions/checkout@v2
- 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 }} --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 }} --tag ${{ matrix.TAG }}