Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 25 additions & 14 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,25 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3.1.0

- name: Build
run: |
docker build \
--tag kooldev/phpqa:${{ matrix.version }} \
${{ matrix.version }}
- 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: |
Expand All @@ -33,14 +47,11 @@ jobs:
docker run kooldev/phpqa:${{ matrix.version }} php-cs-fixer --version
docker run kooldev/phpqa:${{ matrix.version }} local-php-security-checker -help

- name: Login to DockerHub
uses: docker/login-action@v2.1.0
- name: Build and push
uses: docker/build-push-action@v3
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push to DockerHub
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-phpqa'
run: |
docker push kooldev/phpqa:${{ matrix.version }}
context: ${{ matrix.version }}
platforms: linux/amd64,linux/arm64
push: true
tags: kooldev/phpqa:${{ matrix.version }}