File tree 1 file changed +29
-15
lines changed
1 file changed +29
-15
lines changed Original file line number Diff line number Diff line change 1
- name : Deploy
1
+ name : Build and Push Docker Image
2
2
3
3
on :
4
4
push :
5
5
branches :
6
- - main
6
+ - main
7
+
8
+ env :
9
+ REGISTRY : docker.io
10
+ IMAGE_NAME : my-image-name
7
11
8
12
jobs :
9
- deploy :
13
+ build-and-push :
10
14
runs-on : ubuntu-latest
15
+
16
+ permissions :
17
+ contents : read
18
+ packages : read
19
+
11
20
steps :
12
- - name : Login to Docker Hub
13
- uses : docker/login-action@v3
14
- with :
15
- username : ${{ secrets.DOCKER_USERNAME }}
16
- password : ${{ secrets.DOCKER_PASSWORD }}
21
+ - name : Checkout code
22
+ uses : actions/checkout@v3
17
23
18
- - name : Check repository contents
19
- run : ls -l # Verify Dockerfile presence
24
+ - name : Set up Docker Buildx
25
+ uses : docker/setup-buildx-action@v2
20
26
21
- - name : Build and push Docker image
22
- uses : docker/build-push-action@v5
23
- with :
24
- push : true
25
- tags : vikram1202/picpilot:latest
27
+ - name : Login to Docker Hub
28
+ uses : docker/login-action@v2
29
+ with :
30
+ registry : ${{ env.REGISTRY }}
31
+ username : ${{ secrets.DOCKER_HUB_USERNAME }}
32
+ password : ${{ secrets.DOCKER_HUB_PASSWORD }}
26
33
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