Skip to content

Commit 89c006a

Browse files
authored
Update build-docker.yml
1 parent 6f017dc commit 89c006a

File tree

1 file changed

+13
-27
lines changed

1 file changed

+13
-27
lines changed

.github/workflows/build-docker.yml

+13-27
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,24 @@ name: Build and Push Docker Image
33
on:
44
push:
55
branches:
6-
- main
7-
8-
env:
9-
REGISTRY: docker.io
10-
IMAGE_NAME: picpilot
6+
- main # Set the branch you want to trigger the workflow on
117

128
jobs:
139
build-and-push:
1410
runs-on: ubuntu-latest
15-
16-
permissions:
17-
contents: read
18-
packages: read
19-
2011
steps:
21-
- name: Checkout code
22-
uses: actions/checkout@v3
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
15+
- name: Log in to Docker Hub
16+
uses: docker/login-action@v2
17+
with:
18+
username: ${{ secrets.DOCKER_USERNAME }}
19+
password: ${{ secrets.DOCKER_TOKEN }}
2320

24-
- name: Set up Docker Buildx
25-
uses: docker/setup-buildx-action@v2
21+
- name: Build the Docker image
22+
run: docker build -t vikram1202/PicPilot:latest .
2623

27-
- name: Login to Docker Hub
28-
uses: docker/login-action@v2
29-
with:
30-
registry: ${{ env.REGISTRY }}
31-
username: ${{ secrets.DOCKER_USERNAME }}
32-
password: ${{ secrets.DOCKER_PASSWORD }}
24+
- name: Push Docker image to Docker Hub
25+
run: docker push vikram1202/PicPilot:latest
3326

34-
- name: Build and push Docker image
35-
uses: docker/build-push-action@v5
36-
with:
37-
context: .
38-
push: true
39-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
40-
dockerfile: Dockerfile

0 commit comments

Comments
 (0)