-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 2.53 KB
/
deploy.yml
File metadata and controls
73 lines (62 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# .github/workflows/deploy.yml
name: Build and Deploy Portfolio
on:
# Triggers the workflow on push events but only for the 'develop' branch
# !!! IMPORTANT: Change 'develop' to the branch containing your SOURCE CODE !!!
push:
branches: ['develop'] # e.g., main, master, develop
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# 1. Checkout the repository code from your SOURCE branch
- name: Checkout 🛎️
uses: actions/checkout@v4
# 2. Setup PNPM Environment
# Use pnpm/action-setup to install pnpm
- name: Setup PNPM 🅿️
uses: pnpm/action-setup@v3
with:
# Optional: Specify pnpm version to match your local env
# version: 8 # Or the specific version you use
# If omitted, it uses the latest or the version in package.json's packageManager field
version: 10
run_install: false # We'll run install manually in the next step
# 3. Setup Node.js environment (still needed for the runner)
# Tell setup-node to use pnpm's cache
- name: Setup Node.js ⚙️
uses: actions/setup-node@v4
with:
node-version: '20' # Or your desired Node version
cache: 'pnpm' # Specify pnpm for caching dependencies
# 4. Install dependencies using pnpm
- name: Install Dependencies 📦
run: pnpm install
# 5. Build the React application
# Use pnpm run build (or keep npm run build if your script doesn't rely on pnpm specifics)
- name: Build Application 🏗️
# !!! IMPORTANT: Change 'build' to 'dist' if using Vite !!!
run: |
pnpm generate
# Create a .nojekyll file
touch dist/client/.nojekyll
# Adding custom domain
echo "www.anindaghosh.com" > dist/client/CNAME
# 6. Deploy the build output to the 'main' branch (remains the same)
- name: Deploy to main branch 🚀
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: main
publish_dir: ./dist/client # Change to ./dist if using Vite
force_orphan: true
cname: www.anindaghosh.com
# user_name: 'github-actions[bot]' # Optional
# user_email: 'github-actions[bot]@users.noreply.github.com' # Optional
# commit_message: 'Deploy portfolio build' # Optional