Code Monkey home page Code Monkey logo

Comments (11)

Eriice avatar Eriice commented on September 16, 2024 1

Thanks for your help.

I don't know if I should close this issue. if necessary, please help to close it.

from actions-gh-pages.

peaceiris avatar peaceiris commented on September 16, 2024

Please show me your repository.

from actions-gh-pages.

Eriice avatar Eriice commented on September 16, 2024

Please show me your repository.

There is the error commit when blog/static as submodule.

There is the success commit when I remove that submodule.

blog
├── content
│   └── posts // submodule
├── static // can't be submodule 
└── themes
    └── amperage // submodule

from actions-gh-pages.

peaceiris avatar peaceiris commented on September 16, 2024

Try the following.

  • Add find ./public -name ".git" -type d -delete
  • Fix PUBLISH_BRANCH
    - name: Hugo blog CI
      run: |
        hugo -D
        find ./public -name ".git" -type d -delete

    - name: Deploy
      uses: peaceiris/[email protected]
      env:
        PERSONAL_TOKEN: ${{ secrets.ACCESS_TOKEN }}
        PUBLISH_BRANCH: gh-pages
        PUBLISH_DIR: ./public

from actions-gh-pages.

Eriice avatar Eriice commented on September 16, 2024

Try the following.

  • Add find ./public -name ".git" -type d -delete
  • Fix PUBLISH_BRANCH
    - name: Hugo blog CI
      run: |
        hugo -D
        find ./public -name ".git" -type d -delete

    - name: Deploy
      uses: peaceiris/[email protected]
      env:
        PERSONAL_TOKEN: ${{ secrets.ACCESS_TOKEN }}
        PUBLISH_BRANCH: gh-pages
        PUBLISH_DIR: ./public

Thanks for your help, it works well.

And I have tried different combinations about delete .git and change branch name. The key is change the name of branch.

from actions-gh-pages.

Eriice avatar Eriice commented on September 16, 2024

But when I try to commit again with same branch, it occur error.

from actions-gh-pages.

peaceiris avatar peaceiris commented on September 16, 2024

As I wrote the README, it is better to filter the trigger branch.

on:
  push:
    branches:
    - master

Read the documentation carefully and follow the Git branch system.

from actions-gh-pages.

Eriice avatar Eriice commented on September 16, 2024

As I wrote the README, it is better to filter the trigger branch.

on:
  push:
    branches:
    - master

Read the documentation carefully and follow the Git branch system.

I have copy the whole structure of documentation's demo, but it also occur the same error.

From my multiple test, the reason may be we can't build the submodule as first level directory.

git submodule add <git-url> static occur error.

git submodule add <git-url> static/img success.

And if branch is the first time to commit, even if submodule as first level direction, it also success. But when we try to commit second time, It will error.

from actions-gh-pages.

peaceiris avatar peaceiris commented on September 16, 2024

I got it.

In Hugo project, Hugo copies the files under the static folder to the public folder. With this operation, .git is also copies to the public folder and conflict.

I will create a small patch release to ignore .git directory.

Thank you for reporting.

from actions-gh-pages.

peaceiris avatar peaceiris commented on September 16, 2024

Open #63

from actions-gh-pages.

github-actions avatar github-actions commented on September 16, 2024

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved.
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.

from actions-gh-pages.

Related Issues (20)

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.