Skip to content

Commit

Permalink
Add action to create a GitHub page
Browse files Browse the repository at this point in the history
  • Loading branch information
loonkwil committed Sep 28, 2023
1 parent 08d2b78 commit 0eb2411
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build and Deploy

on:
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:


# 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:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Build
run: npm run build
- name: Upload Artifact
uses: actions/upload-pages-artifact@v1
with:
path: "dist"

deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import react from "@vitejs/plugin-react-swc";

// https://vitejs.dev/config/
export default defineConfig({
base: "/beat-the-ai/",
plugins: [react()],
resolve: {
alias: { "~": fileURLToPath(new URL("./src", import.meta.url)) },
Expand Down

0 comments on commit 0eb2411

Please sign in to comment.