Skip to content

Commit

Permalink
workflow: fix acestream-service deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
vstavrinov committed Feb 10, 2023
1 parent 2f81e7b commit 66e8d71
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/main.yml
Expand Up @@ -57,14 +57,6 @@ jobs:
twine upload dist/*
- name: Deploy acestream-service
env:
ACESTREAM_SERVICE_TOKEN: ${{ secrets.ACESTREAM_SERVICE_TOKEN }}
TOKEN: ${{ secrets.ACESTREAM_SERVICE_TOKEN }}
ENDPOINT: "vstavrinov/acestream-service/actions/workflows/main.yml"
run: |
curl -s -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $ACESTREAM_SERVICE_TOKEN" \
-d '{"ref": "master",
"inputs":
{"deploy": "True"}
}' \
https://api.github.com/repos/$ENDPOINT/dispatches
run: ./deploy.sh
22 changes: 22 additions & 0 deletions deploy.sh
@@ -0,0 +1,22 @@
#!/bin/bash -e

REST="curl -siX POST \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: token $TOKEN' \
-d '{\"ref\": \"master\",
\"inputs\":
{\"deploy\": \"true\"}
}' \
https://api.github.com/repos/$ENDPOINT/dispatches"

RETURN="$(eval "$REST")"
echo "$RETURN"
STATUS=$(echo "$RETURN" |
head -1 |
awk '{print $2}')

if [ ${STATUS:=400} -ge 400 ]; then
set -x -v
eval "$REST"
exit 1
fi

0 comments on commit 66e8d71

Please sign in to comment.