New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should be able to publish to GitHub #63
Comments
|
My ideal use of this function would be to publish the static site to gh-pages while keeping the build files in master, but this may be limited to myself. |
|
I'll look at how other implementations are currently doing this but I'm thinking it would make sense to somehow create a clone specifically for deployment purposes. sculpin_deploy_git:
url: git@github.com:user/example.com.git
reference: gh-pagesI envision fetching reference (gh-pages in this example) and then copying the target directory over whatever is in the deploy clone then a fresh @Incognito Would this work for you? Do you have other input? |
|
That's a great solution as the history of gh-pages shouldn't be important, it's simply where the static site happens to go. It has very little need to be git-powered. |
|
As @simensen knows, I'd love to see this featured added to Sculpin. And my hunch is that many developers using Sculpin are probably taking advantage of GitHub Pages for their hosting...it may even be the reason they're using Sculpin. I just came across this article, and thought I'd add it to this ticket. They are doing something very similar, except deploying from Travis-CI. |
|
I have the same use case ... actually surprised this wasn't built-in once I started getting into. This deploy script: https://gist.github.com/mrkrstphr/2e79e55229b2ef7a343a seems like a useful place to start / reference... though prefer it were a sculpin command, not a separate shell script. |
|
+1 |
|
I understand this is about a build-in solution, but now that gh-pages publishing has become much simpler with GitHub's default |
|
@atelierbram i will take a look for a way to change output folder for a target, in the meantime you can symlink docs/ to output_prod/ |
|
currently i use .sh script to deploy, can easily be adapted for travis #!/usr/bin/env bash
set -e
REQUIRED_BRANCH="sculpin"
if [ "$1" != "force" ] && \
[ "$(git symbolic-ref -q HEAD 2>/dev/null)" != "refs/heads/$REQUIRED_BRANCH" ]
then
>&2 echo "It appears we are not in '$REQUIRED_BRANCH' branch."
>&2 echo "Aborting..."
exit 1
fi
# intentionally not possible to deploy if uncommitted changes are present
if [ "$1" != "force" ] && [ "$(git status --porcelain | wc -l)" -ne 0 ]
then
>&2 echo "Working copy is dirty:"
>&2 git status --short
>&2 echo "Aborting..."
exit 1
fi
CURR_COMMIT=$(git rev-parse --short HEAD)
rm -rf ./output_prod
./vendor/bin/sculpin generate --env=prod
echo
rm -rf ./.gh-pages-publish
git clone https://github.com/Xerkus/repo.git -b master --depth 1 \
./.gh-pages-publish
cd .gh-pages-publish
rsync --quiet --archive \
--filter="P .git*" --filter="P CNAME" --filter="P .nojekyll" \
--delete ../output_prod/ ./
rm -rf ../output_prod
git add -A :/
# non-zero exit code on no changes, no new commit or pushing
# should probably check for staged changes in git index
git commit -a -m "Deploying sculpin-generated pages at #$CURR_COMMIT"
if [ "$1" == "push" ]
then
git push origin master
echo "Done and pushed"
exit
fi
echo "Done. Now cd to .gh-pages-publish, verify and push to origin master" |
|
@atelierbram output can be set to docs/ via |
|
@Xerkus Thanks for your research; I am going to look into this. |
|
This is exciting and one of the original features I wanted early on. |
@Xerkus I tested this and it works, great! @Incognito exciting indeed!
sculpin:
output_dir: docs
sculpin_content_types:
posts:
permalink: /:basename/ You can't beat simplicity, it totally works! What's great about this, I think, is that one doesn't have to use elaborate scripts or build-tool-plugins to publish on GitHub anymore: just use their API and let them take care of it. So as far as I am concerned this issue is solved and can be closed, but should be documented, something like this |
|
Here's my take on publish to github pages. I've used link pointed by mdrmike 's as inspiration and some generator that already breathes sculpin's neck, with one force. I know you may not like, that the source of the blog is XX commit's behind master etc. but for me it's simple and ok. The directory goes as a subtree to master. |
|
There's an interesting solution a jekyll user is using, which is 100% compatible with sculpin. https://devlopr.netlify.com/guides/2019/05/21/deploy-blog-using-devlopr-jekyll-and-github-pages/ |
No description provided.
The text was updated successfully, but these errors were encountered: