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

[Docs]: Sample GitHub Actions for deploying to GitHub Pages might be wrong #2919

Closed
omuomugin opened this issue Dec 16, 2024 · 1 comment
Closed

Comments

@omuomugin
Copy link

omuomugin commented Dec 16, 2024

Request Type

Small Fix (wording, errors, typos, etc.)

Description

As I followed Deployment > GitHub Pages, the sample actions did not worked correctly.

I'm guessing BASE_PATH is not working as expected so that uploading artifact fails.
Sorry but I did not dig into implementation of cli yet.

- name: build
  env:
    BASE_PATH: '/${{ github.event.repository.name }}' # -> guessing this part is not working so that upload artifact part fails
    ## Add and uncomment any environment variables here
    ## EVIDENCE_SOURCE__my_source__username: ${{ secrets.EVIDENCE_SOURCE__MY_SOURCE__USERNAME }}
    ## EVIDENCE_SOURCE__my_source__private_key: ${{ secrets.EVIDENCE_SOURCE__MY_SOURCE__PRIVATE_KEY }}
  run: |
    npm run sources
    npm run build

- name: Upload Artifacts
uses: actions/upload-pages-artifact@v3
with:
    path: 'build/${{ github.event.repository.name }}' # -> fails for "directory not found"

changing to below fixed the issue for me

 - name: build
   env:
-    BASE_PATH: '/${{ github.event.repository.name }}'
     ## Add and uncomment any environment variables here
     ## EVIDENCE_SOURCE__my_source__username: ${{ secrets.EVIDENCE_SOURCE__MY_SOURCE__USERNAME }}
     ## EVIDENCE_SOURCE__my_source__private_key: ${{ secrets.EVIDENCE_SOURCE__MY_SOURCE__PRIVATE_KEY }}
   run: |
     npm run sources
     npm run build

 - name: Upload Artifacts
 uses: actions/upload-pages-artifact@v3
 with:
-    path: 'build/${{ github.event.repository.name }}'
+    path: './build

Anyway this project is incredible and we are already planning to migrate our internal tools.

Are you interested in contributing this improvement to the docs?

I'm just making a suggestion

@archiewood
Copy link
Member

archiewood commented Dec 16, 2024

To use basePath as expected you should also update the build command in your package.json.

https://docs.evidence.dev/deployment/base-paths/#configuring-the-build-directory-in-packagejson

This seems to have caught a few people out, so I will update those docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants