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

ci: Add GH workflow to build app & deploy to GH Pages; Update demo link to point at GH Pages deployment. #114

Merged
merged 22 commits into from
Nov 10, 2024
Merged
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
718bc34
Add workflow "Deploy to GitHub Pages".
junhaoliao Nov 9, 2024
1ea5633
Add line before uploading artifacts.
junhaoliao Nov 9, 2024
b395e12
Wrap strings with quotes.
junhaoliao Nov 9, 2024
5690e0d
Update demo link to use GitHub Pages.
junhaoliao Nov 9, 2024
b972057
Place comments before lines.
junhaoliao Nov 9, 2024
e546847
Add `id: "deployment"` into step.
junhaoliao Nov 9, 2024
e11f003
Reformat yaml.
junhaoliao Nov 9, 2024
88bf319
Fix yaml syntax.
junhaoliao Nov 9, 2024
3aea76c
Add `npm` caching.
junhaoliao Nov 9, 2024
6029019
Add name to the cache steps.
junhaoliao Nov 9, 2024
df4a275
test cache.
junhaoliao Nov 9, 2024
108ae1f
Use caching provided by actions/setup-node@v4.
junhaoliao Nov 9, 2024
1bb76c5
Change workflow name.
junhaoliao Nov 9, 2024
10c351c
Avoid spaces in braces - Apply suggestions from code review
junhaoliao Nov 9, 2024
5545ca2
Reformat - Apply suggestions from code review
junhaoliao Nov 9, 2024
6b31dcd
Capitalize first letter in comments - Apply suggestions from code review
junhaoliao Nov 9, 2024
a0ab914
Improve docs for `id-token: "write"` - Apply suggestions from code re…
junhaoliao Nov 9, 2024
dac2d1c
Rename deploy workflow file to use .yaml extension.
junhaoliao Nov 9, 2024
37911e7
Add `submodules: "recursive"` into "actions/checkout@v4".
junhaoliao Nov 9, 2024
ba82b3a
Enable job cancellation in deploy workflow.
junhaoliao Nov 9, 2024
5c46893
yaml: Add line before comment.
junhaoliao Nov 10, 2024
8bccb9a
Remove `actions: "write"` from GITHUB_TOKEN permission list.
junhaoliao Nov 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Deploy to GitHub Pages"
junhaoliao marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
branches: [ "main" ]
junhaoliao marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build:
runs-on: "ubuntu-latest"

junhaoliao marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: "actions/checkout@v4"

- name: "Set up Node.js"
uses: "actions/setup-node@v4"
with:
node-version: "22"

- run: "npm install"
- run: "npm run build"

- name: "Upload static files as artifact"
junhaoliao marked this conversation as resolved.
Show resolved Hide resolved
uses: "actions/upload-pages-artifact@v3"
with:
path: "./dist"

deploy:
needs: "build"
permissions:
pages: "write" # to deploy to Pages
id-token: "write" # to verify the deployment originates from an app
junhaoliao marked this conversation as resolved.
Show resolved Hide resolved
runs-on: "ubuntu-latest"
environment:
name: "github-pages"
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
junhaoliao marked this conversation as resolved.
Show resolved Hide resolved
Loading