-
Notifications
You must be signed in to change notification settings - Fork 10
40 lines (33 loc) · 1.07 KB
/
deploy.yml
File metadata and controls
40 lines (33 loc) · 1.07 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
name: Deploy to GitHub Pages
on:
push:
branches:
- master # Change this to your main branch name
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16 # Change to your Node.js version if needed
- name: Install dependencies
run: npm install # Replace with your package manager command
- name: Build project
run: npm run build # Replace with your build command
- name: Deploy to GitHub Pages
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@users.noreply.github.com"
git checkout --orphan gh-pages
git rm -rf .
mv build/* .
git add -A
git commit -m "Auto-deployed by GitHub Actions"
git branch -D master
git branch -m master
git push -f origin master:gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}