-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
Document .gitignore behaviour #445
Comments
This is not a bug, sorry for botching the label. |
When your In the first place, In your case, your - run: find ./out -name ".gitignore" -delete
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out Or, the following setting will also satisfy your demand. - name: Deploy
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
exclude_assets: '.github,**/.gitignore'
Thanks to your posting, Someone who is interesting in this can find this issue in the future. |
Yep, so this behaviour is fine but what are your thoughts on documenting this on the readme? Do you believe that it's best to keep it on this issue only? |
Thank you for suggesting this. First of all, I strongly recommend users who are facing this case to reconsider a project structure or CI/CD workflow not to set a Git repository to the And, I do not know what to describe this since this case looks natural behavior for me. In my opinion, I don't think documenting is important. If you have a kindly explanation about this, I am willing to merge your suggestion. :-) |
Personally, I am setting up a repository that hosts different projects, and each one of these will have it's own CI workflow, which publishes the build artifacts to a different subdirectory on gh-pages. I was planning on doing that using Now, it's possible to change the CI to isolate the published subdirectories from the rest of the github repo, but that didn't seem as something that needed to be done, so I just went ahead with that and got bit by having all of my build artifacts (which are on .gitignores) not be deployed. With that said, I seem to be the only one that has run into this problem thus far, so I believe it's fine to not document it, just thought that I would explain my case since other users might run into the same problem. |
An option to use a custom gitignore would really help this feel less hacky |
@ChildishGiant We can implement it with simple coreutils commands as follows. As I mentioned above, - run: cp ./.gitignore.production ./public/.gitignore
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public |
Description
Currently, all files that are set to be ignored in .gitignore will not be deployed by the action. This seems to be caused by the
git clone
operation and, while I haven't been able to find any discussion on this in issues or PRs (I used github's search tool, so I might be on the wrong here), I think it's safe to assume that this is the intended behaviour.I believe that this behaviour could be counterintuitive to some users, so it may be interesting to document it on the readme, or at least discuss the idea here.
Reproduction
You can see this behaviour on this CI run.
Reasons why this can be unexpected
I personally got confused by this behaviour, as I expected .gitignored files to be deployed. My thought process went along the lines of:
The text was updated successfully, but these errors were encountered: