File tree 1 file changed +13
-27
lines changed
1 file changed +13
-27
lines changed Original file line number Diff line number Diff line change @@ -3,38 +3,24 @@ name: Build and Push Docker Image
3
3
on :
4
4
push :
5
5
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
11
7
12
8
jobs :
13
9
build-and-push :
14
10
runs-on : ubuntu-latest
15
-
16
- permissions :
17
- contents : read
18
- packages : read
19
-
20
11
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 }}
23
20
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 .
26
23
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
33
26
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
You can’t perform that action at this time.
0 commit comments