-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (31 loc) · 988 Bytes
/
Copy pathmain.yml
File metadata and controls
39 lines (31 loc) · 988 Bytes
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
name: Build & Deploy
on:
push:
branches: [ "main" ]
jobs:
build-deploy:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3.3.0
with:
node-version: '16.x'
- name: Install Project Dependencies
run: npm ci
- name: Install Gatsby CLI
run: npm install -g gatsby-cli
- name: Build the project
run: npm run build
- name: Verify build
run: ls -la && ls -la public
- name: Deploy to github pages
run: |
git config --global user.email "toumangg@gmail.com"
git config --global user.name "Umang Gala"
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npm run deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}