Skip to content

Commit d989db3

Browse files
committed
haskellfoundation#23 Make a site deployment per branch
1 parent b9baff4 commit d989db3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/build-and-deploy.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ git checkout gh-pages
2525
git pull origin gh-pages
2626

2727
site_src="${git_repo_root}/_site"
28-
http_serve_dir="${git_repo_root}/site"
28+
gh_pages_root="${git_repo_root}/gh-pages-root"
2929

3030
if [ "$git_branch" == "$main_git_branch" ]; then
31-
site_dest="${http_serve_dir}"
31+
site_dest="${gh_pages_root}"
3232

3333
# Create temporary backup for other branches content.
34-
mv "${http_serve_dir}/branches" .
34+
mv "${gh_pages_root}/branches" .
3535

3636
# Replace site files.
3737
rm -rf "${site_dest}"
3838
mkdir -p "${site_dest}"
3939
cp -a -v ${site_src}/* ${site_dest}/
4040

4141
# Restore temporary backup for other branches content.
42-
mv ./branches "${http_serve_dir}/"
42+
mv ./branches "${gh_pages_root}/"
4343
else
44-
site_dest="${http_serve_dir}/branches/${git_branch}"
44+
site_dest="${gh_pages_root}/branches/${git_branch}"
4545

4646
# Replace site files.
4747
rm -rf "${site_dest}"

0 commit comments

Comments
 (0)