Closed peaceiris closed 4 years ago
I am guessing this will be similar to the --no-jekyll
option of ghp-import. The javascript gh-pages
utility doesn't have this option, but does have a --dotfiles
option that must be specified to copy over files starting with .
.
Personally I like the ghp-import
design where adding the .nojekyll
file is an opt-in option.
Yes. Some static site generators like Hugo and Gatsby.js support to adding the .nojekyll
file as a static asset. To avoid conflicting with that feature, supporting the add_nojekyll
option may be better for us.
In addition, to enhance the option, we can put the explanation about add_nojekyll
on the top of the README.
You might want to also consider an option to write a CNAME
file for configuring custom domains. For this option, the user would want to pass a string that gets written to the CNAME
file.
As I said at #25, the same may be said of other files (BingSiteAuth.xml, robots.txt, and so on). I think that it is better to manage those files as files.
What is the difference between (BingSiteAuth.xml, robots.txt) and (CNAME, .nojekyll)? Those all look just files. I do not know whether we should provide the add_nojekyll
like feature, or not.
What do you think about this? @dhimmel @nicolas-van
What is the difference between (BingSiteAuth.xml, robots.txt) and (CNAME, .nojekyll)?
The difference is that CNAME
and .nojekyll
have special meaning for GitHub Pages. These files are essentially GitHub Pages settings, whereas the other files you mention are actual parts of the static website that would be relevant to other static hosts besides GitHub Pages.
I see your desire to keep things simple and don't have a strong feeling, but do think these options would be widely used if available. This action is designed for deploying to GitHub Pages.
Personally I think that the fact that some static website generators support adding a .nojekyll
is kind of a bad design from them (their job should just be to generate HTML). On the other hand it should be the job of a tool designed specifically to upload to Github Pages.
Also I think the Jekyll feature of Github as a whole should be considered completely deprecated since the availability of Github Actions. Why would you use a super specific feature when you can basically do whatever you want ? (Including triggering your own Jekyll build if you like that generator, but using an up to date version with the plugins you choose instead of a fixed set which has always been very limited.)
So my opinion regarding the .nojekyll
file generation feature would be:
Regarding CNAME
, now that we speak about it it doesn't seem like a bad idea to add an option to generate it through the custom action. I just think it could be cleaner to have something like that:
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
cname: example.com
Thank like that:
- run: echo "example.com" > public/CNAME
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
Although I would say it doesn't seem very important, that's just personal taste.
I think the Jekyll feature of Github as a whole should be considered completely deprecated since the availability of Github Actions.
amen
To be an opt-out (only for the 0,1% of users that would like to use Github's custom Jekyll generator for legacy reasons)
While I agree the majority of users deploying to gh-pages
probably want .nojekyll
. However, I think this action has a lot of utility as a general purpose deploy-to-branch action. When deploying outputs to branches other than gh-pages
, it could be confusing to users to have to add an option to prevent an extra file from being added.
Thanks all.
OK. I will add two options: disable_nojekyll
and cname
. Thanks to the opinions of you all, I got a clear reason to add those. I thought that we should keep this action's role which is just copying the assets until today, but the specific features of GitHub Pages seem to be necessary for us.
Why adding .nojekyll
is default behavior?
While I agree the majority of users deploying to
gh-pages
probably want.nojekyll
. However, I think this action has a lot of utility as a general purpose deploy-to-branch action. When deploying outputs to branches other thangh-pages
, it could be confusing to users to have to add an option to prevent an extra file from being added.
I agree with this, so I am going to define the behavior like the following:
.nojekyll
file by default for only the master
and gh-pages
branches. When the file already exists, this action does nothing.publish_branch
, this action does not add .nojekyll
file.How about this spec?
Seems good to me.
How about this spec?
Smart!
I opened #119 and released v3.3.0-0
. Test it!
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.3.0-0
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
# github_token: ${{ secrets.GITHUB_TOKEN }}
# personal_token: ${{ secrets.PERSONAL_TOKEN }}
# publish_branch: master
# publish_dir: ./public
disable_nojekyll: true
cname: peaceiris.com
https://github.com/peaceiris/peaceiris.github.io/runs/458272454?check_suite_focus=true#step:6:102
When the CNAME already exists, this action print the waring. Should we stop this action instead of printing the waring?
I don't think it matters too much, but the warning message could be clearer:
##[warning]CNAME already exists
Could this message be updated to indicate whether CNAME will be overwritten or not?
How about this?
##[warning]CNAME already exists, skip adding CNAME
Thank you all @nicolas-van and @dhimmel
You are co-author of #119 and added to the contributors.
Originally posted by @nicolas-van in https://github.com/peaceiris/actions-gh-pages/issues/9#issuecomment-588129844