Skip to content

Commit

Permalink
haskellfoundation#23 Make a site deployment per branch
Browse files Browse the repository at this point in the history
  • Loading branch information
visortelle committed Dec 29, 2021
1 parent b9baff4 commit d989db3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-and-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ git checkout gh-pages
git pull origin gh-pages

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

if [ "$git_branch" == "$main_git_branch" ]; then
site_dest="${http_serve_dir}"
site_dest="${gh_pages_root}"

# Create temporary backup for other branches content.
mv "${http_serve_dir}/branches" .
mv "${gh_pages_root}/branches" .

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

# Restore temporary backup for other branches content.
mv ./branches "${http_serve_dir}/"
mv ./branches "${gh_pages_root}/"
else
site_dest="${http_serve_dir}/branches/${git_branch}"
site_dest="${gh_pages_root}/branches/${git_branch}"

# Replace site files.
rm -rf "${site_dest}"
Expand Down

0 comments on commit d989db3

Please sign in to comment.