Skip to content

Docker Image CI

Docker Image CI #40

Workflow file for this run

name: Docker Image CI
on:
workflow_dispatch:
inputs:
dockerfile_path:
description: Dockerfile path
required: true
default: php/8.2-laravel.Dockerfile
image:
description: Image name
required: true
default: haidarns/php:8.2-laravel-nginx
build_args:
description: Additional docker build args
default: --rm --no-cache
build_env:
description: Docker build environment
default: DOCKER_BUILDKIT=1
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: ${{ github.event.inputs.build_env }} docker build --file ${{ github.event.inputs.dockerfile_path }} --tag ${{ github.event.inputs.image }} ${{ github.event.inputs.build_args }} .
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push docker image
run: docker push ${{ github.event.inputs.image }}