Skip to content

Commit 68c990a

Browse files
committed
add docker build-and-push action
1 parent 3b55b03 commit 68c990a

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.github/workflows/docker-build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build and Push Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- master # main o master, dipende dal tuo branch principale
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Log in to DockerHub
17+
uses: docker/login-action@v3
18+
with:
19+
username: ${{ secrets.DOCKERHUB_USERNAME }}
20+
password: ${{ secrets.DOCKERHUB_TOKEN }}
21+
22+
- name: Build and push Docker image
23+
uses: docker/build-push-action@v6
24+
with:
25+
push: true
26+
tags: morrolinux/morrolinux-it:latest
27+

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM php:8.2-apache
2+
3+
COPY . /var/www/html/
4+
RUN chown -R www-data:www-data /var/www/html
5+
EXPOSE 80
6+

0 commit comments

Comments
 (0)