Skip to content

Build image and push to Docker Hub #6874

Build image and push to Docker Hub

Build image and push to Docker Hub #6874

Workflow file for this run

name: Build image and push to Docker Hub
on:
push:
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build latest
if: ${{ github.ref_name == '8.3' }}
uses: docker/build-push-action@v6
with:
platforms: ${{ secrets.DOCKER_PLATFORMS }}
push: true
tags: rshop/php-apache:latest
-
name: Build and push
uses: docker/build-push-action@v6
with:
platforms: ${{ secrets.DOCKER_PLATFORMS }}
push: true
tags: rshop/php-apache:${{ github.ref_name }}