Skip to content

Commit

Permalink
Automatically build and upload to GH Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
KaffinPX committed Sep 3, 2024
1 parent 03b7fce commit 3ed7ebe
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 12 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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: ['main']

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

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

# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true

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@v4
- name: Use bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.31
- name: Install WASM binaries from aspectron.org
run: wget -O wasm.zip https://kaspa.aspectron.org/nightly/downloads/kaspa-wasm32-sdk-omega-2024-08-18.zip
- name: Extract WASM binaries
run: |
7z x wasm.zip
mkdir ./wasm
mv ./kaspa-wasm32-sdk/web/kaspa/* ./wasm
- name: Install Dependencies
run: bun install --production
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload dist folder
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Binary file modified bun.lockb
Binary file not shown.
16 changes: 4 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"name": "kaspian",
"private": true,
"version": "0.0.0",
"name": "kaspian-krc20",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"dev": "bunx --bun vite --host",
"build": "bunx --bun vite build --minify false"
},
"dependencies": {
"@radix-ui/react-dialog": "^1.1.1",
Expand All @@ -34,13 +31,8 @@
"@types/node": "^22.3.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"postcss": "^8.4.41",
"tailwindcss": "^3.4.10",
"typescript": "^5.2.2",
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [ react() ],
base: "/Kaspian-KRC20/",
resolve: {
alias: {
"@": path.resolve(__dirname, "src")
Expand Down

0 comments on commit 3ed7ebe

Please sign in to comment.