Skip to content

Publish Docker images #415

Publish Docker images

Publish Docker images #415

Workflow file for this run

name: Publish Docker images
on:
push:
branches:
- master
schedule:
- cron: "0 5 * * 1,3,5" # At 05:00 on Monday. Wednesday and Friday
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- version: "5.6"
- version: "7.0"
- version: "7.1"
- version: "7.2"
- version: "7.3"
- version: "7.4"
- version: "8.0"
- version: "8.1"
- version: "8.2"
- version: "8.3"
fail-fast: false
name: Docker (webnazakazku/docker-php:${{ matrix.version }})
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Log in to GitHub Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_CONTAINER_REGISTRY_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push image to GitHub Packages
uses: docker/build-push-action@v2
with:
context: ./
file: Dockerfile-${{ matrix.version }}
push: true
tags: ghcr.io/${{ github.repository_owner }}/docker-php-build:${{ matrix.version }}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push image to Docker Hub
uses: docker/build-push-action@v2
with:
context: ./
file: Dockerfile-${{ matrix.version }}
push: true
tags: webnazakazku/docker-php-build:${{ matrix.version }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
platforms: linux/amd64