-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (60 loc) · 2.62 KB
/
docker-build.yaml
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
name: Docker Build
'on':
push:
tags: [ '*.*.*-*' ]
branches: [ main ]
pull_request:
branches: [ main ]
env:
DOCKER_IMAGE: etriasnl/dev-php-fpm
jobs:
build:
runs-on: ubuntu-latest
steps:
-
uses: actions/[email protected]
-
uses: docker/[email protected]
-
id: build
uses: docker/build-push-action@v4
with:
context: .
load: true
# https://docs.docker.com/build/ci/github-actions/cache/#github-cache
cache-from: type=gha
cache-to: type=gha,mode=max
-
run: |
docker run --rm "${{ steps.build.outputs.imageid }}" node --version
docker run --rm "${{ steps.build.outputs.imageid }}" yarn --version
docker run --rm "${{ steps.build.outputs.imageid }}" pt-online-schema-change --version
docker run --rm "${{ steps.build.outputs.imageid }}" php -v
docker run --rm "${{ steps.build.outputs.imageid }}" php -m
docker run --rm "${{ steps.build.outputs.imageid }}" composer --version
docker run --rm "${{ steps.build.outputs.imageid }}" composer --working-dir=/usr/local/etc/tools normalize --dry-run
docker run --rm "${{ steps.build.outputs.imageid }}" phplint --version
docker run --rm "${{ steps.build.outputs.imageid }}" php-cs-fixer --version --version
docker run --rm "${{ steps.build.outputs.imageid }}" phpunit --version
docker run --rm "${{ steps.build.outputs.imageid }}" psalm --version
docker run --rm "${{ steps.build.outputs.imageid }}" rector --version
-
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
if: github.ref_type == 'tag'
-
id: meta
uses: docker/[email protected]
with:
images: ${{ env.DOCKER_IMAGE }}
if: github.ref_type == 'tag'
-
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
if: github.ref_type == 'tag'