minimal adjustments
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / table / node_modules / ajv / scripts / publish-site
1 #!/usr/bin/env bash
2
3 set -ex
4
5 echo "About to publish $GITHUB_REF to gh-pages..."
6 rm -rf ../gh-pages
7
8 npm run docs:build
9
10 git config --global user.name "$GIT_USER_NAME"
11 git config --global user.email "$GIT_USER_EMAIL"
12 git clone -b gh-pages --single-branch https://"${GH_TOKEN_PUBLIC}"@github.com/ajv-validator/ajv.git ../gh-pages
13
14 rsync -a ./docs/.vuepress/dist/ ../gh-pages
15
16 cd ../gh-pages
17
18 if [[ $(git status --porcelain) ]]; then
19   echo "Changes detected. Updating gh-pages branch..."
20   git add -A
21   git commit -m "updated by ajv workflow https://github.com/ajv-validator/ajv/actions/runs/$GITHUB_RUN_ID"
22   git push --quiet origin gh-pages > /dev/null 2>&1
23 fi
24
25 echo "Done"