File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : 🚀 Deploy
2
+
3
+ on :
4
+ workflow_dispatch : # Allow manual triggering of the workflow
5
+
6
+ jobs :
7
+ tag_and_redeploy :
8
+ runs-on : ubuntu-latest
9
+ if : github.event_name == 'workflow_dispatch'
10
+ steps :
11
+ # Log in to Docker Harbor registry
12
+ - name : 🐳 Log in to Harbor Docker registry
13
+ run : echo "${{ secrets.HARBOR_PASSWORD }}" | docker login ${{ secrets.HARBOR_URL }} -u '${{ secrets.HARBOR_USERNAME }}' --password-stdin
14
+
15
+ # Tag the Docker image as latest
16
+ - name : 🏷️ Tag Docker image as latest
17
+ run : |
18
+ docker pull ${{ secrets.HARBOR_URL }}/${{ secrets.IMAGE_NAME }}:${{ github.sha }}
19
+ docker tag ${{ secrets.HARBOR_URL }}/${{ secrets.IMAGE_NAME }}:${{ github.sha }} ${{ secrets.HARBOR_URL }}/${{ secrets.IMAGE_NAME }}:latest
20
+ docker push ${{ secrets.HARBOR_URL }}/${{ secrets.IMAGE_NAME }}:latest
21
+ - name : ⏳ Wait for the new tag to refresh
22
+ run : sleep 10s
23
+ shell : bash
24
+ # Call the webhook for redeploying the application
25
+ - name : 🔄 Call redeploy webhook
26
+ run : |
27
+ curl -X POST -H "Content-Type: application/json" \
28
+ -d '{"tag": "latest"}' \
29
+ ${{ secrets.REDEPLOY_WEBHOOK_URL }}
You can’t perform that action at this time.
0 commit comments