-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (47 loc) · 1.79 KB
/
ci-cd.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
name: CI/CD
on: [push, workflow_dispatch]
env:
DOCKER_BUILDKIT: 1
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
version: ['7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and export to Docker
uses: docker/build-push-action@v3
with:
context: ${{ matrix.version }}
load: true
tags: kooldev/phpqa:${{ matrix.version }}
- name: Tests
run: |
docker run kooldev/phpqa:${{ matrix.version }} phpunit --version
docker run kooldev/phpqa:${{ matrix.version }} composer -V
docker run kooldev/phpqa:${{ matrix.version }} phan --version
docker run kooldev/phpqa:${{ matrix.version }} phpmd --version
docker run kooldev/phpqa:${{ matrix.version }} phpcpd --version
docker run kooldev/phpqa:${{ matrix.version }} php-cs-fixer --version
docker run kooldev/phpqa:${{ matrix.version }} local-php-security-checker -help
- name: Build and push
uses: docker/build-push-action@v3
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa'
with:
context: ${{ matrix.version }}
platforms: linux/amd64,linux/arm64
push: true
tags: kooldev/phpqa:${{ matrix.version }}