Git Product home page Git Product logo

ghpages's Issues

Return neutral code when nothing to commit

Hi, I use this great action to deploy my website after building the assets with npm scripts.

The fact is that this action also trigger the workflow (as it creates a commit/push on master), so it re-run the workflow... and crash with this (logical) message, as there's noting new to commit.

#################################################
Changing directory to 'BUILD_DIR' . ...
#################################################
Now deploying to GitHub Pages...
Reinitialized existing Git repository in /github/workspace/.git/
On branch master
nothing to commit, working tree clean

### FAILED deploy: gh-pages 10:37:26Z (601ms)

Maybe, in that specific case, it should be great to return a 78 exit code, indicating a neutral stop.

Choose gh-pages and master branch

Github can choose gh-pages and master branch for publishing github pages in non username.github.io repository.

I want to push master branch on repository that selected master branch to publish github pages.
but, ghpages action couldn't choose branch.

Can you update for it?

run integration test

right now, the testing is kinda informal: you can just go to http://www.maxheld.de/ghpages/, and ideally, you should see the last commit sha there if things worked out.

I'd like to have a more fully programmatic way of testing this action, especially as more people rely on it, but I haven't quite figured out an elegant way to do this.

I'd probably involve talking with the GitHub API somehow, to check that the action (given some boilerplate setup) works as intended.

I am also developing this as part of the R package ghactions where I have good unit/integration testing tooling, and I'm not quite sure how that would work here.

Maybe postpone this to a later date, maybe github comes up with something.

Consider creating a `.nojekyll` file

If you're using this action with a documentation built with sphinx, you'll get 404 errors because no .nojekyll file is present in the generated commit.

Maybe this action should be configurable with a jekyll boolean input?

automatically prevent infinite loops

currently we're relying on people setting sensible filter actions before, but it'd be nice to avoid infinite loop armageddon out of the box.

Might happen if people deploy to gh-pages, and that deploy itself (which happens via PAT, not the usual GITHUB_TOKEN which prevents that sort of thing!) might trigger other builds, and so forth.

In simpler projects there shouldn't be any diff to commit on the >1st round, but if there is random stuff in the build such as the build time or something, this might get ugly.

deployment overwrites my master branch with the build

Sorry for coming with such a specific problem, but I'm trying to use the script for deploying a mkdocs website.

For some reason, the result is a brand new commit on master that totally overwrites the repo.

Does anyone have an idea of what happens here?

My .yml :

name: Publication

on:
  push:
    branches:
    - master
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout on Current Commit
      uses: actions/checkout@master
    - name: Setup python
      uses: actions/setup-python@v1
      with:
        python-version: '3.x'
        architecture: 'x64'
    - name: Install requirements
      run: python -m pip install -r py-requirements.txt
    - name: Build with mkdocs
      run: python -m mkdocs build --clean
    - name: Say that this is not Jekyll
      run: cat > site/.nojekyll
    - name: Publish site
      uses: maxheld83/[email protected]
      env:
        BUILD_DIR: "site/"
        GH_PAT: ${{ secrets.GH_PAT }}

Full code can be seen on gitlab (not on github since repo is reinitialized with each deploy ;-) :
https://gitlab.com/know-rmandie/know-rmandie.gitlab.io/blob/master/.github/workflows/mkdocs.yml

alloy deploy to master branch /docs/

to fully cover the possibilities for GitHub pages sources, as per the docs, I guess we'd need this to.

(this is an extension of #3)

I'm a little cautious about this one, because deploying to docs/ you might:

  • overwrite something unintentionally using this action
  • pollute the commit history (I guess this is part of the docs/ logic)
  • bloat your repo size (see below)

We'd need to be quite careful with the git command as well; currently we can just write to some branch and delete all of its history and be done with it.

So this seems to add a lot of complexity.

Also, I just think docs/, if used at all, should be used by directly committing to it, not through some CI/CD.

GitHub default branch name is main

The Entrypoint.sh script currently has the master branch hardcoded, but the default github branch is now main. Suggest setting that as a parameter or updating to use the new default.

git push --force $REMOTE_REPO master:$REMOTE_BRANCH && \

Does not work with the root directory (BUILD_DIR = /.)

It seems that the command add . from your script does not work correctly for the root dir in BUILD_DIR.

Here is the output I get with BUILD_DIR = /..
If I change the value, for example, to dist/ everything will work fine.

#################################################
Changing directory to 'BUILD_DIR' /. ...
#################################################
Now deploying to GitHub Pages...
warning: adding embedded git repository: github/workspace
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint: 
hint: 	git submodule add <url> github/workspace
hint: 
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint: 
hint: 	git rm --cached github/workspace
hint: 
hint: See "git help submodule" for more information.
error: open("proc/1/mem"): Permission denied
error: unable to index file proc/1/mem
fatal: adding files failed
Initialized empty Git repository in /.git/

### FAILED GitHub Pages Deploy 17:24:08Z (10.705s)

CNAME file

If you have a CNAME file, it will need to be added before deploy each time, otherwise your custom domain will be reset.

It would be great to have a GH_CNAME env var.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.