Skip to content
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

Publishing assets fails with "cp: cannot create directory" #591

Closed
peschee opened this issue Mar 31, 2021 · 4 comments
Closed

Publishing assets fails with "cp: cannot create directory" #591

peschee opened this issue Mar 31, 2021 · 4 comments
Assignees
Labels
bug Something isn't working resolved

Comments

@peschee
Copy link

peschee commented Mar 31, 2021

Describe the bug

I have the following in my Github Actions config:

- name: Deploys
  uses: peaceiris/actions-gh-pages@v3
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: ./storybook-static
    allow_empty_commit: true

Until recently, the publishing to gh-pages worked perfectly. Now, I'm getting the following error in the "Prepare publishing assets" phase of the action:

  [INFO] copy /home/runner/work/portal-components/portal-components/storybook-static to /home/runner/actions_github_pages_1617177227961
  cp: cannot create directory '/home/runner/actions_github_pages_1617177227961': No such file or directory

Full output is:

Prepare publishing assets
  [INFO] ForceOrphan: false
  /usr/bin/git clone --depth=1 --single-branch --branch gh-pages ***github.com/inventage/portal-components.git /home/runner/actions_github_pages_1617177227961
  Cloning into '/home/runner/actions_github_pages_1617177227961'...
  [INFO] clean up /home/runner/actions_github_pages_1617177227961
  [INFO] chdir /home/runner/actions_github_pages_1617177227961
  /usr/bin/git rm -r --ignore-unmatch *
  rm '.nojekyll'
  rm '21bc7de4.js'
  rm '48ed5318.js'
  rm 'custom-elements.json'
  rm 'data/data-settings.json'
  rm 'data/data.json'
  [INFO] chdir /home/runner/actions_github_pages_1617177227961
  [INFO] prepare publishing assets
  [INFO] copy /home/runner/work/portal-components/portal-components/storybook-static to /home/runner/actions_github_pages_1617177227961
  cp: cannot create directory '/home/runner/actions_github_pages_1617177227961': No such file or directory
  [INFO] delete excluded assets
  rm: no paths given
  [INFO] Created /home/runner/actions_github_pages_1617177227961/.nojekyll

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://github.com/inventage/portal-components/runs/2234944681?check_suite_focus=true
  2. In the console output, click on "Deploys" → "Prepare publishing assets"
  3. The published page should be here: https://inventage.github.io/portal-components/; the gh-pages branch (https://github.com/inventage/portal-components/tree/gh-pages) is missing the necessary files for the deployment to work

Expected behavior

The documentation should be published at https://inventage.github.io/portal-components/

Your YAML file

@peschee peschee added the bug Something isn't working label Mar 31, 2021
@peaceiris
Copy link
Owner

Thank you for reporting! I confirmed the reproducibility by myself. I will investigate this more deeply.

@peaceiris
Copy link
Owner

peaceiris commented Mar 31, 2021

I got it. Please check the generating process of the test-data.json. The following workaround will fix the deployment.

      - name: Build
        run: npm run build

      - run: |
          cd storybook-static/data
          unlink test-data.json
          ln -s ../../components/portal-navigation/test/test-data.json test-data.json

This action failed to catch this type of error. I will enhance the error handling and log format. ;)

@peschee
Copy link
Author

peschee commented Mar 31, 2021

test-data.json is a symbolic link to a subfolder that might not be uploaded to gh-pages, thanks for catching that!

So this is not a bug in your action.

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working resolved
Projects
None yet
Development

No branches or pull requests

2 participants