Skip to content

Commit 6884ff5

Browse files
committed
GHPG-1: gh action deployment config added
1 parent 3455197 commit 6884ff5

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

.github/workflows/deploy.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v3
16+
17+
- name: Setup Node
18+
uses: actions/setup-node@v3
19+
20+
- name: Install dependencies
21+
uses: bahmutov/npm-install@v1
22+
23+
- name: Build project
24+
run: npm run build
25+
26+
- name: Upload production-ready build files
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: production-files
30+
path: ./dist
31+
32+
deploy:
33+
name: Deploy
34+
needs: build
35+
runs-on: ubuntu-latest
36+
if: github.ref == 'refs/heads/main'
37+
38+
steps:
39+
- name: Download artifact
40+
uses: actions/download-artifact@v3
41+
with:
42+
name: production-files
43+
path: ./dist
44+
45+
- name: Deploy to GitHub Pages
46+
uses: peaceiris/actions-gh-pages@v3
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
publish_dir: ./dist

vite.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { defineConfig } from 'vite'
2-
import react from '@vitejs/plugin-react'
1+
import react from '@vitejs/plugin-react';
2+
import { defineConfig } from 'vite';
33
import AppConfig from "./app.config.js";
44

55
// https://vitejs.dev/config/
66
export default defineConfig({
77
plugins: [react()],
8+
base: "/scotch-music-react/",
89
server: AppConfig.dev
910
})

0 commit comments

Comments
 (0)