Skip to content

Commit

Permalink
updates to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
KartikWatts committed Oct 17, 2024
1 parent 45fa480 commit 32971d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 28 deletions.
37 changes: 9 additions & 28 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,30 @@
name: Deploy
name: Deploy App to GitHub Pages

on:
push:
branches:
- main

jobs:
build:
name: Build
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
uses: bahmutov/npm-install@v1
run: npm ci

- name: Build project
run: npm run build

- name: Upload production-ready build files
uses: actions/upload-artifact@v3
with:
name: production-files
path: ./dist

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: production-files
path: ./dist

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_dir: ./dist
1 change: 1 addition & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: "/chess-arena/",
});

0 comments on commit 32971d7

Please sign in to comment.