Skip to content

Commit 0cbde5c

Browse files
authored
Create deploy.yml
1 parent 09056d2 commit 0cbde5c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ] # or your default branch name (could be 'master')
6+
workflow_dispatch: # allows manual triggering
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '16' # or your preferred Node.js version
19+
20+
- name: Install dependencies
21+
run: npm install # or yarn install
22+
23+
- name: Build with API key
24+
env:
25+
REACT_APP_API_KEY: ${{ secrets.API_KEY }} # Uses the secret you'll create
26+
run: npm run build # or your build command
27+
28+
- name: Deploy to GitHub Pages
29+
uses: JamesIves/github-pages-deploy-action@v4
30+
with:
31+
folder: build # or your build output directory (dist, public, etc.)
32+
branch: gh-pages # The branch the action should deploy to

0 commit comments

Comments
 (0)