Skip to content

Commit 327d1c5

Browse files
authored
Merge pull request #4 from rmodi6/main
Merge main to staging
2 parents defbde9 + 5684acc commit 327d1c5

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Deploy Production Site
2+
3+
# Trigger on pushes to the main branch
4+
on:
5+
push:
6+
branches: [ "main" ]
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Step 1: Check out the code from the main branch
13+
- name: Checkout main
14+
uses: actions/checkout@v4
15+
16+
# Step 2: Deploy to gh-pages branch (root directory)
17+
- name: Deploy to Production
18+
uses: peaceiris/actions-gh-pages@v4
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }} # Auto-generated by GitHub
21+
publish_branch: gh-pages # Branch to deploy to
22+
publish_dir: . # Directory with built files (use _site for Jekyll/Hugo)
23+
destination_dir: . # Deploy to root of gh-pages
24+
force_orphan: true # Keep gh-pages clean (only built files)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Deploy Staging Site
2+
3+
# Trigger on pushes to the staging branch
4+
on:
5+
push:
6+
branches: [ "staging" ]
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
# Step 1: Check out the code from the staging branch
13+
- name: Checkout staging
14+
uses: actions/checkout@v4
15+
16+
# Step 2: Deploy to gh-pages branch (staging subdirectory)
17+
- name: Deploy to Staging
18+
uses: peaceiris/actions-gh-pages@v4
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
publish_branch: gh-pages
22+
publish_dir: . # Same as production (e.g., _site for generators)
23+
destination_dir: staging # Deploy to /staging in gh-pages
24+
force_orphan: false # Don’t overwrite production files in gh-pages

0 commit comments

Comments
 (0)