microsoft / AzureTipsAndTricks

Learn some of our favorite Azure tips and tricks—some long-standing, and new ones that have recently been added to become more productive with Azure. Star the repo now to shave hours off your coding tasks tomorrow.
http://azuredev.tips
Creative Commons Attribution 4.0 International
1.49k stars 489 forks source link

VuePress Build Instructions? #6

Closed SeaDude closed 5 years ago

SeaDude commented 5 years ago

Hello, These are great docs. I've been trying to stand up something similar. Are you able to share your workflow for publishing these VuePress docs? I've walked through the official docs several times and can't seem to get:

  1. Markdown files to render in VuePress. The Github Pages template takes over.
  2. An automated build process without using a 3rd party. Any insights are greatly appreciated. Thank you
mbcrump commented 5 years ago

For #1 - Make sure you go into settings for your repo (on GitHub) and select the correct branch for your GitHub pages. It should be gh-pages. You can switch to my gh-pages branch to see mine.

If you still have problems then you can check out VuePress boilerplate while it is not official, I have found it helpful to look through the code.

For #2 - Nothing fancy here. I use SSH to connect to GitHub. I also have npm, vuepress, git installed on my Mac and run a shell script to deploy to GitHub. Below is a copy of it

#!/usr/bin/env sh

# abort on errors
set -e

# build
npm run build

# navigate into the build output directory
cd public

# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME

git init
git add -A
git commit -m 'deploy'

# if you are deploying to https://<USERNAME>.github.io
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master

# if you are deploying to https://<USERNAME>.github.io/<REPO> - This is what I'm using
git push -f git@github.com:microsoft/azuretipsandtricks.git master:gh-pages

cd -

cd src

git init
git add -A
git commit -m "deploy"
git push -f git@github.com:microsoft/azuretipsandtricks.git master

I hope this helps.

mbcrump commented 5 years ago

Closing -> contact me on twitter for further questions on this

SeaDude commented 5 years ago

Great insights and recommendations. Thank you very much @mbcrump!