File tree Expand file tree Collapse file tree 4 files changed +15
-8
lines changed Expand file tree Collapse file tree 4 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 1010 - uses : actions/checkout@v2
1111 with :
1212 fetch-depth : 0
13- ref : gh-pages
13+ ref : hakyll
1414
1515 - name : Remove stale deployments
1616 run : ./.github/workflows/deployment/delete.sh $GITHUB_REF_NAME
Original file line number Diff line number Diff line change @@ -14,3 +14,6 @@ slugify() {
1414 echo " $1 " | iconv -c -t ascii//TRANSLIT | sed -E ' s/[~^]+/-/g' | sed -E ' s/[^a-zA-Z0-9]+/-/g' | sed -E ' s/^-+|-+$/-/g' | tr A-Z a-z
1515}
1616export -f slugify
17+
18+ git config user.name github-actions
19+ git config user.email github-actions@github.com
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33# Remove deployment by specified git branch name.
4- # Script assumes that you are on gh-pages branch.
54
65set -eo pipefail
76
87script_dir=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd)
98source $script_dir /commons.sh
109
11- branch_slug=$( $script_dir /slugify.sh $1 )
10+ git checkout gh-pages
11+ git pull origin gh-pages
1212
13+ branch_slug=$( $script_dir /slugify.sh $1 )
1314rm -rf " $deployments_dir /$branch_slug "
15+
16+ echo " Updating gh-pages branch."
17+ git add --all
18+ git commit --allow-empty -m " Delete '${$1 } ' branch deployment [ci skip]"
19+ git push --force origin gh-pages
20+ echo " Deployment for branch '$1 ' has been deleted."
Original file line number Diff line number Diff line change @@ -7,9 +7,6 @@ set -eo pipefail
77script_dir=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd)
88source $script_dir /commons.sh
99
10- git config user.name github-actions
11- git config user.email github-actions@github.com
12-
1310deploy () {
1411 if [[ ! -z " $GITHUB_REF_NAME " ]]; then
1512 # The GITHUB_REF_NAME env variable is available in github actions.
@@ -47,7 +44,7 @@ deploy() {
4744
4845 echo " Updating gh-pages branch."
4946 git add --all
50- git commit --allow-empty -m " [ $( date ' +%F %T %Z ' ) ] Updated site for the ' ${git_branch} ' branch [ci skip]"
47+ git commit --allow-empty -m " Update ' ${git_branch} ' branch deployment [ci skip]"
5148 git push --force origin gh-pages
5249 echo " Deployment finished."
5350}
@@ -86,7 +83,7 @@ update_deployments_list() {
8683
8784 # Update gh-pages branch
8885 git add --all
89- git commit --allow-empty -m " Update ${deployments_list} "
86+ git commit --allow-empty -m " Update ${deployments_list} [ci skip] "
9087 git push --force origin gh-pages
9188}
9289
You can’t perform that action at this time.
0 commit comments