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

Add support for absolute paths #242

Closed
koppor opened this issue Apr 19, 2020 · 6 comments · Fixed by #400
Closed

Add support for absolute paths #242

koppor opened this issue Apr 19, 2020 · 6 comments · Fixed by #400
Assignees
Labels

Comments

@koppor
Copy link

koppor commented Apr 19, 2020

      - name: Deploy docs to gh-pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          PUBLISH_BRANCH: gh-pages
          PUBLISH_DIR: /tmp/out

Results in

 ENOENT: no such file or directory, scandir '/home/runner/work/user-documentation/user-documentation/tmp/out'

I assume that the first slash is just stripped?

@koppor koppor added the bug Something isn't working label Apr 19, 2020
@peaceiris peaceiris added enhancement New feature or request proposal and removed bug Something isn't working labels Apr 20, 2020
@peaceiris
Copy link
Owner

It comes from this line:

const publishDir = path.join(
`${process.env.GITHUB_WORKSPACE}`,
inps.PublishDir
);

Currently, this action just supports the directories under the ${GITHUB_WORKSPACE}. We will support the absolute path.

@misfir3
Copy link

misfir3 commented Apr 22, 2020

FYI, I also get this same error when using the relative ./public path, but my hugo files are also one level in, so in my actions workflow, I do the following:

      # change dir and build
      - name: Build
        run: cd hugo-dir && hugo --cleanDestinationDir && cd ../

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

Is this likely the same issue here? Also, I was getting the same error w/o cd ../ (which should actually work)

@peaceiris
Copy link
Owner

@misfir3 There is a misunderstanding about a step. For each step starts from GITHUB_WORKSPACE so cd ../ is not necessary. The correct setting is the following:

      - name: Build
        run: cd hugo-dir && hugo

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

@misfir3
Copy link

misfir3 commented Apr 23, 2020

thanks @peaceiris - figured out my mistake after posting ☝️ and have it sorted now. Sorry for the noise and thanks for the work on this action!

@peaceiris
Copy link
Owner

The v3.6.4 has been released and the v3 tag has been updated.

@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants