Clarity around automated deployment to gh-pages
NullVoxPopuli opened this issue · 7 comments
I've had a couple confusions with the deployment process, and am wondering if others have had the same issue.
When I first started the project, I had to manually create the gh-pages branch.. but I also had to make sure it was an empty branch -- delete all my repository files -- as I don't need addon source deploy as if it's a website. There is no home index.html though: https://github.com/NullVoxPopuli/ember-jsqr/tree/gh-pages I haven't yet dug in to this to see what could be wrong. I suspect it may have something going wrong around this code: https://github.com/ef4/ember-cli-deploy-git/blob/master/index.js#L44 (one of the ember-cli-deploy plugins addon-docs uses)
So, idk if other people have had these issues, and additions to the guides would be helpful?
- create empty gh-pages branch before deploying
- ?? (whatever I need to do to fix the root index.html (and related assets) missing issue
Update (maybe not directly related to deployment, but I am using GH Actions with all this)
Forgot that I also had to do this in the GH Action
run: echo "::set-env name=ADDON_DOCS_VERSION_PATH::${GITHUB_REF##*/}"
related: #437
The addon docs default is to only publish a version, and not overwrite the root. If you run ADDON_DOCS_UPDATE_LATEST=true ember deploy production it should force it to overwrite the root.
Ah, that's what that means. Cool. I'll give it a go! Thanks!
also, I had to do this:
run: echo "::set-env name=ADDON_DOCS_VERSION_PATH::${GITHUB_REF##*/}"
for github actions.
(just documenting stuff for others to find it quicker)
Definitely feel free to open a PR to talk about GitHub actions in the official docs 😃
Once I figure out a good setup, I def will!
Yay, the root of my gh-pages has content now! https://github.com/NullVoxPopuli/ember-jsqr/tree/gh-pages
Also running into trouble with some of this setup. I've got a custom domain for my gh-pages site, and it github wants you to put a CNAME file at the root. I tried adding that manually to the gh-pages root (seemed like a good idea at the time) but then every time I deployed that file it would get deleted and would knock the site offline.
Turns out you need to stick that CNAME file in /tests/dummy/public in your addon as I discovered from deep within the ember discord. Adding this comment for future travelers