Replies: 10 comments 9 replies
-
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 }} |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
I'd like to bring to your attention this action https://github.com/JamesIves/github-pages-deploy-action
|
Beta Was this translation helpful? Give feedback.
-
Thank you, it works like a charm now. |
Beta Was this translation helpful? Give feedback.
-
Maybe a GitHub gist would be enough for deploying slidev, its process is actually similar to deploying other static sites. |
Beta Was this translation helpful? Give feedback.
-
One additionally callout to make here is that if you want "pasteable" urls you need to use hash routing and not history based routing |
Beta Was this translation helpful? Give feedback.
-
The line |
Beta Was this translation helpful? Give feedback.
-
Oh interesting! I didn't know that (it makes total sense though!). Thanks! |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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 :)
Beta Was this translation helpful? Give feedback.
All reactions