Skip to content

Commit

Permalink
ci: update staging.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Ar Rakin <rakinar2@onesoftnet.eu.org>
  • Loading branch information
virtual-designer authored Sep 6, 2024
1 parent 21ff88e commit 18f5eca
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,29 @@ jobs:
id: create_deployment
run: |
# Create a deployment
curl -X POST \
out=$(curl -fSsL -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/deployments \
-d '{"ref": "${{ github.sha }}", "environment": "staging", "auto_merge": false, "required_contexts": [], "description": "Deploying new release"}'
-d '{"ref": "${{ github.sha }}", "environment": "staging", "auto_merge": false, "required_contexts": [], "description": "Deploying new release"}');
if [ -z "$out" ]; then
echo "Invalid output"
exit 1;
fi;
id=$(cat $out | jq -r .id);
if [ -z "$id" ]; then
echo "Invalid ID"
exit 1;
fi;
echo "id=$id" >> $GITHUB_OUTPUT;
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set Deployment Status to Pending
id: set_deployment_status_pending
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
Expand Down

0 comments on commit 18f5eca

Please sign in to comment.