-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (33 loc) · 1005 Bytes
/
main.yml
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
name: Deploy on Push
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout code
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
# Step 3: Install dependencies
- name: Install dependencies
run: npm install
# Step 4: Build the project
- name: Build the project
run: npm run build
# Step 5: Set Git identity
- name: Set Git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "matinanadali"
# Step 6: Deploy using gh-pages
- name: Deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx gh-pages -d dist --repo https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git