**ci(workflows): add GitHub Actions workflow for GitHub Pages deployment**
### Changes: - Introduced a new `github-pages.yml` workflow in `.github/workflows/`. - Configured the workflow to: - Trigger on pushes to the `main` branch. - Deploy files from the `./examples` directory to GitHub Pages. - Utilize Actions such as `checkout`, `configure-pages`, `upload-pages-artifact`, and `deploy-pages`. - Set up necessary permissions for deploying to GitHub Pages. ### Purpose: Added an automated GitHub Actions workflow to streamline the deployment of content to GitHub Pages. This ensures a consistent and efficient process for updating the demo or documentation hosted online.
This commit is contained in:
parent
ebeb86d178
commit
3014a32e20
1 changed files with 33 additions and 0 deletions
33
.github/workflows/github-pages.yml
vendored
Normal file
33
.github/workflows/github-pages.yml
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
name: Deploy to GitHub Pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main # Set this to the branch you want to deploy from
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Pages
|
||||||
|
uses: actions/configure-pages@v3
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-pages-artifact@v2
|
||||||
|
with:
|
||||||
|
path: './examples' # Upload the examples directory
|
||||||
|
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v2
|
||||||
Loading…
Add table
Add a link
Reference in a new issue