Skip to content

Merge pull request #11 from hussainweb/dependabot/github_actions/dock… #131

Merge pull request #11 from hussainweb/dependabot/github_actions/dock…

Merge pull request #11 from hussainweb/dependabot/github_actions/dock… #131

Workflow file for this run

name: Build Docker images
on:
schedule:
- cron: '21 14 * * 0'
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
DOCKERFILE_DIR: '8.x'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: hussainweb
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: hussainweb
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image for PHP ${{ matrix.php_version }}
uses: docker/build-push-action@v6
with:
context: ${{ env.DOCKERFILE_DIR }}/debian/
push: ${{ github.event_name != 'pull_request' }}
tags: |
hussainweb/drupalqa:php${{ matrix.php_version }}
${{ matrix.php_version == '8.3' && 'hussainweb/drupalqa:latest' || '' }}
ghcr.io/hussainweb/drupalqa:php${{ matrix.php_version }}
${{ matrix.php_version == '8.3' && 'ghcr.io/hussainweb/drupalqa:latest' || '' }}
build-args: |
PHP_VERSION=php${{ matrix.php_version }}