more circle garbo

main
Evan Hemsley 2019-09-15 12:31:37 -07:00
parent a21e77d34a
commit 52f0449cb7
1 changed files with 11 additions and 6 deletions

View File

@ -7,11 +7,17 @@ jobs:
environment: environment:
BRANCH: master BRANCH: master
TARGET_REPO: moontools-docs/moontools-docs.github.io.git TARGET_REPO: moontools-docs/moontools-docs.github.io.git
DOCS_CHECKOUT_DIR: ~/checkout
HUGO_BUILD_DIR: ~/checkout/bonk
steps: steps:
- checkout - checkout
- run:
command: git submodule sync && git submodule update --init
- run: - run:
name: "Run Hugo" name: "Run Hugo"
command: HUGO_ENV=production hugo -v command: HUGO_ENV=production hugo -v -d $HUGO_BUILD_DIR
- run:
command:
- deploy: - deploy:
name: "Deploy website" name: "Deploy website"
command: | command: |
@ -21,15 +27,14 @@ jobs:
git config --global user.email "builds@circleci.com" git config --global user.email "builds@circleci.com"
git config --global user.name "CircleCI" git config --global user.name "CircleCI"
#using token clone gh-pages branch #using token clone gh-pages branch
git clone --quiet --branch=$CIRCLE_BRANCH https://${GH_TOKEN}@github.com/$TARGET_REPO built_website > /dev/null git clone --quiet --branch=$CIRCLE_BRANCH https://${GH_TOKEN}@github.com/$TARGET_REPO $DOCS_CHECKOUT_DIR > /dev/null
#go into directory and copy data we're interested in to that directory #go into directory and copy data we're interested in to that directory
cd built_website cd $HUGO_BUILD_DIR
echo "rsync built code with checked out code..." echo "rsync built code with checked out code..."
rsync -r --exclude=.git --delete ~/project/public ./ rsync -r --exclude=.git --delete ~/project/public $HUGO_BUILD_DIR
mv ./public ./bonk
#add, commit and push files #add, commit and push files
echo "add files to git..." echo "add files to git..."
git add -f . git add --all
echo "commit files to git repository..." echo "commit files to git repository..."
if git commit -m "CircleCI build $CIRCLE_BUILD_NUM pushed to Github Pages" ; then if git commit -m "CircleCI build $CIRCLE_BUILD_NUM pushed to Github Pages" ; then
echo "git push files with force..." echo "git push files with force..."