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 : CD
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+
7+ permissions :
8+ contents : read
9+ packages : write
10+ id-token : write
11+
12+ concurrency :
13+ group : deploy-${{ github.ref_name }}
14+ cancel-in-progress : true
15+
16+ jobs :
17+ CI :
18+ uses : ./.github/workflows/CI.yml
19+ deploy :
20+ needs : CI
21+ if : ${{ needs.CI.result == 'success' }}
22+ permissions : {}
23+ uses : ./.github/workflows/deploy.yml
24+ secrets :
25+ COOLIFY_WEBHOOK : ${{ secrets.COOLIFY_WEBHOOK }}
26+ COOLIFY_TOKEN : ${{ secrets.COOLIFY_TOKEN }}
Original file line number Diff line number Diff line change 1- name : CI/CD
1+ name : CI
22
33on :
4- push :
5- branches : [ "main" ]
4+ workflow_call :
65 pull_request :
76 branches : [ "main" ]
87
2221 packages : write
2322 id-token : write
2423 uses : ./.github/workflows/docker.yml
25- deploy :
26- permissions : {}
27- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
28- needs : docker
29- uses : ./.github/workflows/deploy.yml
30- secrets :
31- COOLIFY_WEBHOOK : ${{ secrets.COOLIFY_WEBHOOK }}
32- COOLIFY_TOKEN : ${{ secrets.COOLIFY_TOKEN }}
Original file line number Diff line number Diff line change 1717 steps :
1818 - name : Deploy
1919 run : |
20- curl --request GET '${{ secrets.COOLIFY_WEBHOOK }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'
20+ curl --fail-with-body -- request GET '${{ secrets.COOLIFY_WEBHOOK }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'
Original file line number Diff line number Diff line change 2626 uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
2727
2828 - name : Log into registry ${{ env.REGISTRY }}
29+ if : github.ref == 'refs/heads/main'
2930 uses : docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
3031 with :
3132 registry : ${{ env.REGISTRY }}
@@ -39,15 +40,14 @@ jobs:
3940 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4041 tags : |
4142 type=ref,event=branch
42- type=ref,event=pr
4343 type=ref,event=tag
4444 type=sha
4545
4646 - name : Build and push Docker image
4747 uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
4848 with :
4949 context : .
50- push : true
50+ push : ${{ github.ref == 'refs/heads/main' }}
5151 tags : ${{ steps.meta.outputs.tags }}
5252 labels : ${{ steps.meta.outputs.labels }}
5353 cache-from : type=gha
You can’t perform that action at this time.
0 commit comments