Skip to content

Commit 53a0f3e

Browse files
Add GitHub Actions workflow for GitHub Pages deployment
This workflow automates the deployment of the website to GitHub Pages upon pushing to the main branch, including steps for checking out the code, setting up Node.js, installing dependencies, building the website, and deploying the build directory.
1 parent 32c7542 commit 53a0f3e

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Hoặc 'master' tùy tên nhánh chính của bạn
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
name: Deploy to GitHub Pages
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
cache: npm
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build website
26+
run: npm run build
27+
28+
- name: Deploy to GitHub Pages
29+
uses: peaceiris/actions-gh-pages@v3
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
publish_dir: ./build
33+
cname: brewkits.dev # Quan trọng

0 commit comments

Comments
 (0)