Skip to content

Commit

Permalink
feat: implement yaml script to deploy react app
Browse files Browse the repository at this point in the history
  • Loading branch information
0xabdulkhaliq committed May 15, 2024
1 parent 22a7d03 commit 2465591
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/deploy-react-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy React App

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: npm install

- name: Build React app
run: npm run build

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist
clean: true
single-commit: true
token: ${{ secrets.GITHUB_TOKEN }}
commit-user-name: "github-actions[bot]"
commit-user-email: "github-actions[bot]@users.noreply.github.com"
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link
rel="canonical"
href="https://cv-application-0xabdulkhalid.vercel.app/"
href="https://0xabdulkhalid.github.io/cv-application/"
/>
<title>CV Application</title>
</head>
Expand Down
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: '/cv-application/',
})

0 comments on commit 2465591

Please sign in to comment.