push-pages -> push
This commit is contained in:
36
push
Executable file
36
push
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# https://github.com/cirosantilli/china-dictatorship#mirrors
|
||||
|
||||
set -eux
|
||||
make
|
||||
git push --follow-tags
|
||||
git push git@gitlab.com:cirosantilli/china-dictatorship.git
|
||||
|
||||
# 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"
|
||||
git clone --branch gh-pages --depth 1 "$(git remote get-url origin)" "$gh_pages_dir"
|
||||
fi
|
||||
cp README.html "${gh_pages_dir}/index.html"
|
||||
git -C "$gh_pages_dir" add .
|
||||
if git -C "$gh_pages_dir" commit -m "$(git log -1 --format="%H")"; then
|
||||
git -C "$gh_pages_dir" push
|
||||
fi
|
||||
|
||||
# GitLab pages
|
||||
gl_pages_dir=out/gl-pages
|
||||
if [ ! -d "$gl_pages_dir" ]; then
|
||||
mkdir -p "${gl_pages_dir}/public"
|
||||
git clone --branch gl-pages --depth 1 git@gitlab.com:cirosantilli/china-dictatorship.git remote get-url origin "$gl_pages_dir"
|
||||
fi
|
||||
make MEDIA=https://gitlab.com/cirosantilli/china-dictatorship-media/-/raw/master OUT="${gl_pages_dir}/public/index.html"
|
||||
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
|
||||
fi
|
||||
Reference in New Issue
Block a user