grunt-gh-pages
grunt-gh-pages copied to clipboard
How to copy to root
Hi,
I'm trying to get this tool to copy everything from my project's ./dist folder to the git clone gh-pages but I want all the files from the dist folder only. From what I understood, this is the default config:
'gh-pages': {
options: {
base: 'dist',
},
src: '**'
},
What I understood is that with this config everything from "dist" will be copied to a new branch called "gh-pages" with only the things in dist. What is happening is that it's copying the whole project into this branch and not only this folder... am I missing something?
Thanks in advance!
@bsides what version of grunt
and grunt-gh-pages
are you using?
Let me know if this config works for you:
grunt.initConfig({
'gh-pages': {
options: {
base: 'dist'
},
all: {
src: ['**']
}
}
});
Didn't work either, but worry not - I just used git for it:
git subtree push --prefix dist origin gh-pages
With this command it will push just the dist folder into the branch gh-pages. I even put it on my .gitconfig file to make it faster:
gh = "! f() { git subtree push --prefix $1 origin gh-pages; }; f"
This way I just call git gh dist
and it's done :smile_cat:
grunt.initConfig({
'gh-pages': {
options: {
base: 'dist'
},
all: {
src: ['**']
}
}
});
This worked for me.
It didn't work twice though. Running grunt gh-pages-clean helped though.
Same issue as @steveoh, worked the first time but not the second.
I believe I have a similar problem, but none of the solutions helped. My file structure is like this:
.
├── ...
└── dist
├── file1
└── file2
I want the following to be published to GitHub pages:
.
├── file1
└── file2
Whichever option I try, the output is always put inside dist
and not at the root of the repo, i.e.:
.
└── dist
├── file1
└── file2
Any ideas?