Skip to content

Commit

Permalink
add: github page + base url
Browse files Browse the repository at this point in the history
  • Loading branch information
james-gates-0212 committed May 7, 2024
1 parent 91fb2e9 commit 1625d33
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 3 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Auto Assign
on:
issues:
types: [opened]
pull_request:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: 'Auto-assign issue'
uses: pozil/auto-assign-issue@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
assignees: james-gates-0212
numOfAssignee: 1
11 changes: 11 additions & 0 deletions .github/workflows/proof-html.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Proof HTML
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: anishathalye/[email protected]
with:
directory: ./
64 changes: 64 additions & 0 deletions .github/workflows/vite-github-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy Vite Project 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: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm 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
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import NavBar from './components/Navbar';
import Stars from './backgrounds/Stars';
import About from './pages/About';

const isDevelopmentMode = process.env.NODE_ENV === 'development';
const isProductionMode = process.env.NODE_ENV === 'production';
// const isDevelopmentMode = import.meta.env.NODE_ENV === 'development';
// const isProductionMode = import.meta.env.NODE_ENV === 'production';

function App() {
return (
Expand All @@ -18,7 +18,7 @@ function App() {
zIndex: 1000,
}}
>
<Router basename={isProductionMode ? '/web3-background-animation' : '/'}>
<Router basename="/web3-background-animation">
<div className="App">
<NavBar />
<Routes>
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
base: '/web3-background-animation/',
plugins: [react()],
});

0 comments on commit 1625d33

Please sign in to comment.