Skip to content

Commit fc25f68

Browse files
committed
add push to dockerhub
1 parent 8b87858 commit fc25f68

2 files changed

Lines changed: 38 additions & 18 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and publish Docker image
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
11+
push_to_registry:
12+
name: Push Docker image to Docker Hub
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Check out the repo
18+
uses: actions/checkout@v3
19+
20+
- name: Log in to Docker Hub
21+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
22+
with:
23+
username: ${{ secrets.DOCKER_USERNAME }}
24+
password: ${{ secrets.DOCKER_PASSWORD }}
25+
26+
- name: Extract metadata (tags, labels) for Docker
27+
id: meta
28+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
29+
with:
30+
images: unicdocker/drupal-php
31+
32+
- name: Build and push Docker image
33+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
34+
with:
35+
context: .
36+
push: true
37+
tags: ${{ steps.meta.outputs.tags }}
38+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/docker-image.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)