2019-12-26 15:25:43 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
2020-01-04 16:17:28 +00:00
|
|
|
BRANCH="now"
|
2019-12-26 15:25:43 +00:00
|
|
|
|
|
|
|
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:
|
2019-12-26 15:25:43 +00:00
|
|
|
|
|
|
|
git checkout ${BRANCH}
|
2019-12-31 06:41:10 +00:00
|
|
|
cp -vr /tmp/public/* .
|
2019-12-26 15:25:43 +00:00
|
|
|
git config user.name "GitHub Actions"
|
|
|
|
git config user.email "github-actions-bot@users.noreply.github.com"
|
2019-12-31 06:41:10 +00:00
|
|
|
git add .
|
2020-01-04 16:17:28 +00:00
|
|
|
git commit -m "Deploy new version docs"
|
2019-12-31 06:41:10 +00:00
|
|
|
git push --force "https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" ${BRANCH}
|
2019-12-26 15:25:43 +00:00
|
|
|
|
|
|
|
echo "Deploy complete"
|
|
|
|
}
|
|
|
|
|
|
|
|
build
|
|
|
|
deploy
|