@@ -55,43 +55,4 @@ deploy() {
5555 echo " Deployment finished."
5656}
5757
58- update_deployments_list () {
59- github_project_url=$( git remote get-url origin)
60- if [[ $github_project_url == git@github.com:* ]]; then
61- github_repo=$( echo ${github_project_url# " git@github.com:" } | sed ' s/\.git$//g' )
62- elif [[ $github_project_url == https://github.com/* ]]; then
63- github_repo=$( echo ${github_project_url# " https://github.com/" } | sed ' s/\.git$//g' | sed ' s/^\/\///g' )
64- fi
65-
66- github_repo_owner=$( echo " ${github_repo} " | sed ' s/\/.*$//g' )
67- github_repo_name=$( echo " ${github_repo} " | sed ' s/^.*\///g' )
68-
69- deployments_list=" DEPLOYMENTS.md"
70- echo " Updating ${deployments_list} "
71- rm $deployments_list
72-
73- # Create a markdown table
74- touch $deployments_list
75- echo " # Deployments" >> $deployments_list
76- echo " " >> $deployments_list
77- echo " | Branch | Link |" >> $deployments_list
78- echo " | --- | --- |" >> $deployments_list
79-
80- main_deployment_url=" https://${github_repo_owner} .github.io/${github_repo_name} /"
81- echo " | [${main_git_branch} ](https://github.com/${github_repo_owner} /${github_repo_name} /tree/${branch} ) | [Open](${main_deployment_url} ) |" >> $deployments_list
82-
83- remote_branches=$( git ls-remote --heads origin | sed ' s?.*refs/heads/??' | grep -v " gh-pages" | grep -v " ${main_git_branch} " )
84- echo " $remote_branches " | while IFS= read -r branch; do
85- branch_slug=$( slugify $branch )
86- deployment_url=" https://${github_repo_owner} .github.io/${github_repo_name} /branches/${branch_slug} "
87- echo " | [${branch} ](https://github.com/${github_repo_owner} /${github_repo_name} /tree/${branch} ) | [Open](${deployment_url} ) |" >> $deployments_list
88- done
89-
90- # Update gh-pages branch
91- git add --all
92- git commit --allow-empty -m " Update ${deployments_list} [ci skip]"
93- git push --force origin gh-pages
94- }
95-
9658deploy
97- update_deployments_list
0 commit comments