Skip to content

Commit

Permalink
TASK: Github action to build and push php development image to docker…
Browse files Browse the repository at this point in the history
…hub (#418)

* Adding a build docker dev github workflow.:

* Adjust context

* Adding checkout step.

* Updating to only execute when branch is master and Dockerfile is changed.
  • Loading branch information
arvinsingla authored Feb 27, 2024
1 parent 3b1d6a3 commit 0367495
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-docker-dev-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish PHP Development Docker image

on:
push:
branches:
- 'master'
paths:
- 'docker/php/Dockerfile'

jobs:
deploy-dev-image:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- 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 and push
uses: docker/build-push-action@v5
with:
context: ./docker/php
push: true
tags: formulize/php-dev:latest
6 changes: 2 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ version: "3"

services:
web:
build:
context: ./docker/php
dockerfile: Dockerfile
image: "formulize/php-dev:latest"
restart: 'no'
depends_on:
- mariadb
Expand All @@ -17,7 +15,7 @@ services:
links:
- mariadb
mariadb:
image: "mariadb"
image: "mariadb:lts"
restart: 'no'
ports:
- 3306:3306
Expand Down

0 comments on commit 0367495

Please sign in to comment.