Skip to content

Commit c634983

Browse files
authored
Trigger digital ocean redeploy whenever an image is pushed (#23)
1 parent 6f15e32 commit c634983

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/prod_container_img.yml

+16
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,19 @@ jobs:
7878
echo VERSION=$VERSION
7979
podman tag $IMAGE_NAME $IMAGE_ID:$VERSION
8080
podman push $IMAGE_ID:$VERSION
81+
82+
trigger-redeploy:
83+
name: Trigger Redeploy
84+
if: github.ref == 'refs/heads/master'
85+
runs-on: ubuntu-24.04
86+
needs: [build]
87+
steps:
88+
- name: Install jq
89+
run: sudo apt-get install jq
90+
- name: Trigger
91+
run: |
92+
curl -X POST \
93+
-H "Content-Type: application/json" \
94+
-H "Authorization: Bearer ${{ secrets.DIGITALOCEAN_TOKEN }}" \
95+
"https://api.digitalocean.com/v2/apps/${{ secrets.DIGITALOCEAN_APP_ID }}/deployments" \
96+
| jq '.deployment.id' | grep -v null > /dev/null

0 commit comments

Comments
 (0)