2020-08-04 06:00:05 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
# https://github.com/cirosantilli/china-dictatorship#mirrors
|
|
|
|
|
|
|
|
|
|
set -eux
|
|
|
|
|
make
|
|
|
|
|
git push --follow-tags
|
2021-04-28 04:00:03 +00:00
|
|
|
git push git@gitlab.com:cirosantilli/china-dictatorship.git
|
2020-08-04 06:00:05 +00:00
|
|
|
|
|
|
|
|
# GitHub pages.
|
|
|
|
|
# One time initial setup.
|
|
|
|
|
# git checkout --orphan gh-pages
|
|
|
|
|
# and copy over https://github.com/cirosantilli/jekyll-min
|
|
|
|
|
gh_pages_dir=out/gh-pages
|
|
|
|
|
if [ ! -d "$gh_pages_dir" ]; then
|
|
|
|
|
mkdir -p "$gh_pages_dir"
|
2021-04-28 08:00:07 +00:00
|
|
|
git clone --branch gh-pages --depth 1 "$(git remote get-url origin)" "$gh_pages_dir"
|
2020-08-04 06:00:05 +00:00
|
|
|
fi
|
|
|
|
|
cp README.html "${gh_pages_dir}/index.html"
|
2021-04-28 03:00:02 +00:00
|
|
|
git -C "$gh_pages_dir" add .
|
2020-08-04 06:00:05 +00:00
|
|
|
if git -C "$gh_pages_dir" commit -m "$(git log -1 --format="%H")"; then
|
|
|
|
|
git -C "$gh_pages_dir" push
|
2021-04-28 13:00:12 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# GitLab pages
|
2021-06-07 11:22:15 +01:00
|
|
|
out_dir=out/
|
|
|
|
|
gl_pages_dir="${out_dir}/gl-pages"
|
2021-04-28 13:00:12 +00:00
|
|
|
if [ ! -d "$gl_pages_dir" ]; then
|
2021-06-07 11:22:15 +01:00
|
|
|
mkdir -p "${out_dir}"
|
|
|
|
|
git clone --branch gl-pages --depth 1 git@gitlab.com:cirosantilli/china-dictatorship.git "$gl_pages_dir"
|
2021-04-28 13:00:12 +00:00
|
|
|
fi
|
2021-04-29 01:00:00 +00:00
|
|
|
make MEDIA=https://gitlab.com/cirosantilli/china-dictatorship-media/-/raw/master OUT="${gl_pages_dir}/public/index.html"
|
2021-04-28 13:00:12 +00:00
|
|
|
cp .gitlab-ci.yml "${gl_pages_dir}"
|
|
|
|
|
git -C "$gl_pages_dir" add .
|
|
|
|
|
if git -C "$gl_pages_dir" commit -m "$(git log -1 --format="%H")"; then
|
|
|
|
|
git -C "$gl_pages_dir" push
|
2020-08-04 06:00:05 +00:00
|
|
|
fi
|