File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Build and Push Docker Image to Docker Hub
2-
3- on : push
1+ name : Build Docker Image
2+ on :
3+ push :
4+ branches :
5+ - main
46jobs :
5- push_to_registry :
6- name : push docker image to hub
7- runs-on : ubuntu-latest
8- steps :
9- - name : check repository
10- uses : actions/checkout@v4
11-
12- - name : login to docker registry
13- uses : docker/login-action@v3
14- with :
15- username : ${{secrets.DOCKERHUB_USERNAME}}
16- password : ${{secrets.DOCKERHUB_TOKEN}}
17-
18- - name : build and push docker image to registry
19- uses : docker/build-push-action@v5
20- with :
21- context : DockerFileFolder/
22- push : true
23- tags : fadillahrizki/notes-backend:latest
7+ build :
8+ name : push docker image to docker hub
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v2
12+ - name : login to docker hub
13+ id : docker-hub
14+ env :
15+ username : ${{secrets.DOCKERHUB_USERNAME}}
16+ password : ${{secrets.DOCKERHUB_TOKEN}}
17+ run : |
18+ docker login -u $username -p $password
19+ - name : build the docker image
20+ id : build-docker-image
21+ run : |
22+ ls -la
23+ docker build . -f Dockerfile -t fadillahrizki/notes-backend:latest
24+ - name : push the docker image
25+ id : push-docker-image
26+ run : docker push ${{secrets.DOCKERHUB_USERNAME}}/notes-backend:latest
You can’t perform that action at this time.
0 commit comments