mirror of
https://github.com/cs341-illinois/coursebook.git
synced 2026-10-02 08:04:38 +08:00
* Initial Github Actions workflow + script modifications * Remove old keys * Add deploy key * Rename deploy key * Oops add back * Some changes after testing with website repo * Remove env section * Temporary changes for testing CI * Enable github-actions on this branch for testing * Fix? * Only test out EPUB * Fix? * Fix? * Update * Typo and enable PDF * Enable WIKI * Add site deploy key * Revert testing changes + Disable Github Actions on this branch * Update README * Typo * Lowercase
33 lines
756 B
Bash
33 lines
756 B
Bash
#!/bin/bash
|
|
|
|
# Every script should have this
|
|
set -e
|
|
|
|
DOCS_SHA=$(git rev-parse --short HEAD)
|
|
|
|
# Create a temp directory, so we don't get raced by the filesystem
|
|
WIKI_DIR=`mktemp -d`
|
|
|
|
CLONE_URL="git@github.com:${GITHUB_REPOSITORY}.wiki.git"
|
|
echo "Cloning $CLONE_URL into $WIKI_DIR"
|
|
git config --global core.sshCommand "ssh -i /tmp/deploy_wiki -F /dev/null"
|
|
git clone $CLONE_URL $WIKI_DIR
|
|
|
|
# If we get race condition on read only files, we need to fix our build system
|
|
# no temp directory here
|
|
|
|
echo "Copying Wiki"
|
|
cp _wiki/* ${WIKI_DIR}
|
|
|
|
cd ${WIKI_DIR}
|
|
|
|
git add -A
|
|
git commit -m "Updating wiki to ${DOCS_SHA}" --author "$COMMITTER_EMAIL <$AUTHOR_NAME>" || true
|
|
git push origin
|
|
|
|
cd ${GITHUB_WORKSPACE}
|
|
|
|
|
|
# Part 2, Update the site
|
|
bash _scripts/site_deploy.sh
|