Skip to content

Commit d095aeb

Browse files
Add workflow to push Docker image to Docker Hub
1 parent d54e346 commit d095aeb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/docker-publish.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+
- main
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Log in to Docker Hub
17+
uses: docker/login-action@v3
18+
with:
19+
username: ${{ secrets.DOCKER_USERNAME }}
20+
password: ${{ secrets.DOCKER_PASSWORD }}
21+
22+
- name: Build and push Docker image
23+
uses: docker/build-push-action@v5
24+
with:
25+
context: .
26+
push: true
27+
tags: rmsh/goit-pythonweb-hw-03:latest

0 commit comments

Comments
 (0)