This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Providing Official GitHub Actions to host on GitHub Pages quickly #168
Comments
This is my current GitHub Actions workflow that I use for deploying slidev to Pages, if it can be of any help. name: Deploy pages
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2.1.5
with:
node-version: '14'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: |
yarn install
- name: Build application
run: |
yarn build
cp dist/index.html dist/404.html
- name: Deploy pages
uses: crazy-max/ghaction-github-pages@v2.3.0
with:
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Actually there are some problems with deploying to GitHub Pages, if you just add the ci.yml by @dizys and push to GitHub, the page would fail due to absolute path reference. For example in |
Oh, I shoulda mentioned that Slidev CLI has an option called So, when I'm writing my build script in // package.json
{
// ...
"scripts": {
"build": "slidev build --base /my-repo-name/",
// ...
},
// ...
} Or... writing the base option into your workflow yaml file should also work fine. # .github/workflows/deploy-pages.yml
# ...
jobs:
build:
# ...
steps:
# ...
- name: Build application
run: |
yarn build --base /my-repo-name/
cp dist/index.html dist/404.html
# ... Thank you for pointing this out. |
I'd like to bring to your attention this action https://github.com/JamesIves/github-pages-deploy-action
|
Thank you, it works like a charm now. |
Maybe a GitHub gist would be enough for deploying slidev, its process is actually similar to deploying other static sites. |
One additionally callout to make here is that if you want "pasteable" urls you need to use hash routing and not history based routing |
The line |
Oh interesting! I didn't know that (it makes total sense though!). Thanks! |
This is my github actions that build each slides based on the commit message, deploy in github pages in the same repo and update main README.md to add the new link in my list of slides. https://github.com/fguisso/talks/blob/main/.github/workflows/github-pages.yml |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Is your feature request related to a problem? Please describe.
Thanks for this Great Project!
Currently, slidev is providing SPA that user can host it on GitHub Pages.
If slidev providing GitHub Actions to host on GitHub Pages, it would be more convenient I think.
Describe the solution you'd like
Providing GitHub Actions to host in GitHub Pages.
Describe alternatives you've considered
Nothing.
I'll do this :)
The text was updated successfully, but these errors were encountered: