rust-search-extension/scripts/deploy-docs.sh

33 lines
690 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e
BRANCH="now"
build() {
echo "Starting building..."
cd docs
sudo snap install --edge zola
zola build
mv public /tmp/public
cd ..
}
deploy() {
echo "Starting deploying..."
2019-12-26 16:13:03 +00:00
git config --global url."https://".insteadOf git://
git config --global url."https://github.com/".insteadOf git@github.com:
git checkout ${BRANCH}
cp -vr /tmp/public/* .
git config user.name "GitHub Actions"
git config user.email "github-actions-bot@users.noreply.github.com"
git add .
git commit -m "Deploy new version docs"
git push --force "https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" ${BRANCH}
echo "Deploy complete"
}
build
deploy