Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4656447

Browse files
committedDec 29, 2021
haskellfoundation#23 Make a site deployment per branch
1 parent f1134af commit 4656447

File tree

3 files changed

+45
-12
lines changed

3 files changed

+45
-12
lines changed
 

‎.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.
2+
# More: https://editorconfig.org/
3+
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
charset = utf-8
12+
end_of_line = lf
13+
14+
[Makefile]
15+
indent_style = tab

‎.github/workflows/deploy.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
set -exo pipefail
4+
5+
script_dir=$(dirname "$0")
6+
git_repo_root=$(git rev-parse --show-toplevel)
7+
git_branch=$(git rev-parse --abbrev-ref HEAD)
8+
9+
git config user.name github-actions
10+
git config user.email github-actions@github.com
11+
12+
stack exec --system-ghc site rebuild
13+
14+
site_src="${git_repo_root}/_site"
15+
site_dest="${git_repo_root}/branches/${git_branch}"
16+
17+
git checkout gh-pages
18+
git pull --rebase
19+
20+
# Overwrite existing files with new files
21+
rm -rf "${site_dest}"
22+
mkdir -p "${site_dest}"
23+
cp -a -v "${site_src}" "${site_dest}"
24+
25+
# Commit
26+
git add --all
27+
git commit -m "[$(date '+%F %T %Z')] Updated site for the '${git_branch}' branch [ci skip]"
28+
# Push
29+
git push origin gh-pages

‎.github/workflows/main.yml

+1-12
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,4 @@ jobs:
5454
# Runs a set of commands using the runners shell
5555
- name: Deploy
5656
run: |
57-
git config user.name github-actions
58-
git config user.email github-actions@github.com
59-
stack exec --system-ghc site rebuild
60-
git checkout main
61-
git pull --rebase
62-
# Overwrite existing files with new files
63-
cp -a -v _site/. .
64-
# Commit
65-
git add --all
66-
git commit -m "[`date '+%F %T %Z'`] New release [ci skip]"
67-
# Push
68-
git push origin main:main
57+

0 commit comments

Comments
 (0)
Please sign in to comment.