File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ name : spring-boot Docker Image CI
2+ on :
3+ push :
4+ branches : [ master ]
5+ workflow_dispatch :
6+
7+
8+ jobs :
9+ docker :
10+ runs-on : ubuntu-latest
11+ steps :
12+ -
13+ name : Set up QEMU
14+ uses : docker/setup-qemu-action@v1
15+ -
16+ name : Set up Docker Buildx
17+ uses : docker/setup-buildx-action@v1
18+ -
19+ name : Login to DockerHub
20+ uses : docker/login-action@v1
21+ with :
22+ username : ${{ secrets.DOCKERHUB_USERNAME }}
23+ password : ${{ secrets.DOCKERHUB_TOKEN }}
24+ -
25+ name : Build and push
26+ id : docker_build
27+ uses : docker/build-push-action@v2
28+ with :
29+ platforms : linux/amd64
30+ push : true
31+ file : Dockerfile
32+ tags : ${{ secrets.DOCKERHUB_USERNAME }}/spring-boot:prod-v${{ github.run_number }}
33+ -
34+ name : Image digest
35+ run : echo ${{ steps.docker_build.outputs.digest }}
36+
37+ # - name: Download new image and run new containers
38+ # uses: JimCronqvist/action-ssh@master
39+ # with:
40+ # hosts: 'ubuntu@ec2-52-207-24-140.compute-1.amazonaws.com'
41+ # privateKey: ${{ secrets.SSH_PRIVATE_KEY }}
42+ # debug: false
43+ # command: |
44+ # sudo docker-compose -f /home/ubuntu/django-demo/docker-compose.yml down
45+ # sudo docker-compose -f /home/ubuntu/django-demo/docker-compose.yml pull
46+ # sudo docker image prune -f
47+ # sudo docker-compose -f /home/ubuntu/django-demo/docker-compose.yml up -d
You can’t perform that action at this time.
0 commit comments