Skip to content

Commit 9c72454

Browse files
committed
haskellfoundation#23 Make a site deployment per branch
1 parent 0c8e0fd commit 9c72454

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/deploy.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,21 @@ github_repo_name=$(echo "${github_repo}" | sed 's/^.*\///g')
7676
git_head_sha=$(git rev-parse --verify HEAD)
7777

7878
if [ "$git_branch" == "$main_git_branch" ]; then
79+
deployment_environment = "production"
7980
deployment_url="https://${github_repo_owner}.github.io/${github_repo_name}/"
8081
else
82+
deployment_environment = "qa"
8183
deployment_url="https://${github_repo_owner}.github.io/${github_repo_name}/branches/${git_branch}"
8284
fi
8385

8486
update_github_checks_req_data() {
8587
cat <<EOF
8688
{
8789
"name": "deployment",
88-
"head_sha": "${git_head_sha}",
89-
"status": "completed",
90-
"conclusion": "success",
91-
"details_url": "${deployment_url}"
90+
"ref": "${git_branch}",
91+
"environment": "${deployment_environment}",
92+
"payload": "some payload https://xyz.abc",
93+
"description": "some description https://abc.xyz"
9294
}
9395
EOF
9496
}
@@ -100,6 +102,6 @@ curl -i \
100102
--header "Content-Type: application/json" \
101103
--data "$(update_github_checks_req_data)" \
102104
--fail \
103-
https://api.github.com/repos/${github_repo_owner}/${github_repo_name}/check-runs
105+
https://api.github.com/repos/${github_repo_owner}/${github_repo_name}/deployments
104106

105107
echo "Deployment is available at: '${deployment_url}'"

0 commit comments

Comments
 (0)