peaceiris / actions-gh-pages

GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.
https://github.com/marketplace/actions/github-pages-action
MIT License
4.61k stars 366 forks source link

support: Github Pages not deployed, even when action is successfull #961

Closed anticdimi closed 1 year ago

anticdimi commented 1 year ago

Checklist

Describe your question

Hi @peaceiris , Thank you for your work, it really is useful!

My website can't deploy correctly. It seems like the public/dir is not created in the correct location (see the log output bellow). Any hints on how to solve this?

Relevant links

Public repository: /
YAML config: 

name: Deploy GitHub Pages

on:
  push:
    branches:
      - main 
  pull_request:

jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: true  # Fetch any Git submodules (true OR recursive)
          fetch-depth: 0    # Fetch all history for .GitInfo and .Lastmod

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'
          extended: true

      - name: Build
        run: hugo --minify

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3.9.3
        with:
          publish_branch: gh-pages
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./public

YAML workflow:

Relevant log output

[INFO] copy /home/runner/work/anticdimi.github.io/anticdimi.github.io/public to /home/runner/actions_github_pages_1692352328176 cp: no such file or directory: /home/runner/work/anticdimi.github.io/anticdimi.github.io/public/.*

Additional context.

No response

Darker commented 1 year ago

I have the same problem. This is my log:

  [INFO] ForceOrphan: false
  /usr/bin/git clone --depth=1 --single-branch --branch gh-pages ***github.com/Darker/battletech-techsheet.git /home/runner/actions_github_pages_1692478804848
  Cloning into '/home/runner/actions_github_pages_1692478804848'...
  [INFO] clean up /home/runner/actions_github_pages_1692478804848
  [INFO] chdir /home/runner/actions_github_pages_1692478804848
  /usr/bin/git rm -r --ignore-unmatch *
  rm '.nojekyll'
  [INFO] chdir /home/runner/actions_github_pages_1692478804848
  [INFO] prepare publishing assets
  [INFO] copy /home/runner/work/battletech-techsheet/battletech-techsheet/web/root to /home/runner/actions_github_pages_1692478804848
  cp: no such file or directory: /home/runner/work/battletech-techsheet/battletech-techsheet/web/root/*
  cp: no such file or directory: /home/runner/work/battletech-techsheet/battletech-techsheet/web/root/.*
  [INFO] delete excluded assets
  rm: no paths given
  [INFO] Created /home/runner/actions_github_pages_1692478804848/.nojekyll

The only file that ends up in gh-pages branch is the .nojekyll file created at the end.

peaceiris commented 1 year ago

@anticdimi Your ./public looks empty, I think.

@Darker Your ./web/root looks empty too.

peaceiris commented 1 year ago

Here is my new example repo. FYI https://github.com/peaceiris/test-mdbook

Darker commented 1 year ago

I may have misunderstood the purpose of this action. I thought it would publish from master to gh-pages. I have in the meantime resolved this by using a different action. Byt my web/root in master was not empty: https://github.com/Darker/battletech-techsheet/tree/master/web/root

anticdimi commented 1 year ago

Hi @peaceiris , I don't think that is the case, because when I run hugo --minify on my local machine, the ./public dir actually contains the website content.

anticdimi commented 1 year ago

I have also solved this issue by using a different deployment method.

github-actions[bot] commented 1 year ago

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.

Log | Bot Usage