Skip to content

Commit

Permalink
Re-enable Portainer deployment (#1180)
Browse files Browse the repository at this point in the history
* Re-enable Portainer deployment
Fixes #896

* Add verbose flag

* Finalize variable names
  • Loading branch information
neilenns authored Mar 21, 2024
1 parent 5572989 commit 7a6c8b4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/dev_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ jobs:
# -H adds the two Cloudflare headers to allow webhook access
- name: Deploy to Portainer
run: |
status_code=$(curl -X POST \
status_code=$(curl -v -X POST \
-L \
-w "%{http_code}" \
-s \
-o /dev/null \
-H "CF-Access-Client-Id: ${{ secrets.CF_ACCESS_CLIENT_ID }}" \
-H "CF-Access-Client-Secret: ${{ secrets.CF_ACCESS_CLIENT_SECRET }}" \
"${{ secrets.PORTAINER_WEBHOOK_URL }}")
"${{ vars.PORTAINER_WEBHOOK_URL }}")
echo "Status code received: $status_code"
if [ $status_code -eq 200 ]; then
if [ $status_code -eq 204 ]; then
echo "Deployment succeeded"
else
echo "Deployment failed"
Expand Down
56 changes: 28 additions & 28 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
build-and-push-image:
environment: production
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -64,31 +65,30 @@ jobs:
build-args: |
VERSION=${{ github.event.release.tag_name }}
# Issue 889: Disable for now until Portainer fixes the bug on their end preventing this from working
# deploy:
# runs-on: ubuntu-latest
# needs: build-and-push-image
# environment: production
# steps:
# - name: Deploy to Portainer
# -L makes curl follow the redirect from cloudflare
# -w captures the HTTP code
# -s is silent so no progress bar shows
# -o /dev/null sends the response to null so it doesn't contaminate the response code
# -H adds the two Cloudflare headers to allow webhook access
# run: |
# status_code=$(curl -X POST \
# -L \
# -w "%{http_code}" \
# -s \
# -o /dev/null \
# -H "CF-Access-Client-Id: ${{ secrets.CF_ACCESS_CLIENT_ID }}" \
# -H "CF-Access-Client-Secret: ${{ secrets.CF_ACCESS_CLIENT_SECRET }}" \
# "${{ secrets.PORTAINER_WEBHOOK_URL }}")
# echo "Status code received: $status_code"
# if [ $status_code -eq 200 ]; then
# echo "Deployment succeeded"
# else
# echo "Deployment failed"
# exit 1
# fi
deploy:
runs-on: ubuntu-latest
needs: build-and-push-image
environment: production
steps:
# -L makes curl follow the redirect from cloudflare
# -w captures the HTTP code
# -s is silent so no progress bar shows
# -o /dev/null sends the response to null so it doesn't contaminate the response code
# -H adds the two Cloudflare headers to allow webhook access
- name: Deploy to Portainer
run: |
status_code=$(curl -v -X POST \
-L \
-w "%{http_code}" \
-s \
-o /dev/null \
-H "CF-Access-Client-Id: ${{ secrets.CF_ACCESS_CLIENT_ID }}" \
-H "CF-Access-Client-Secret: ${{ secrets.CF_ACCESS_CLIENT_SECRET }}" \
"${{ vars.PORTAINER_WEBHOOK_URL }}")
echo "Status code received: $status_code"
if [ $status_code -eq 204 ]; then
echo "Deployment succeeded"
else
echo "Deployment failed"
exit 1
fi

0 comments on commit 7a6c8b4

Please sign in to comment.