Skip to content

Commit

Permalink
chore: deploy github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Cweili committed Jan 5, 2024
1 parent 0978bac commit ed38e8e
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: [$default-branch]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: './build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test": "vitest --typecheck",
"lint": "prettier --check . && eslint --ignore-path .gitignore .",
"format": "prettier --write .",
"deploy": "npm run build && gh-pages -t -d build"
"format": "prettier --write ."
},
"exports": {
".": {
Expand Down Expand Up @@ -63,7 +62,6 @@
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.35.1",
"gh-pages": "^6.1.1",
"highlight.js": "^11.9.0",
"jsdom": "^23.0.1",
"prettier": "^3.1.1",
Expand Down

0 comments on commit ed38e8e

Please sign in to comment.