Skip to content

Commit 75c84fe

Browse files
committed
fix: github action deploy script
1 parent 77509b4 commit 75c84fe

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

.github/workflows/deploy.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
name: Deploy to GitHub Pages
22

33
on:
4+
push:
5+
branches:
6+
- main
47
workflow_dispatch:
58

69
jobs:
7-
deploy:
10+
build-and-deploy:
811
runs-on: ubuntu-latest
912

1013
steps:
1114
- name: Checkout code
1215
uses: actions/checkout@v2
13-
with:
14-
persist-credentials: false # 수동 인증 정보를 덮어쓰지 않도록 설정
15-
16-
- name: Configure Git
17-
run: |
18-
git config --global user.name "github-actions"
19-
git config --global user.email "toothlessdev@users.noreply.github.com"
2016

2117
- name: Install dependencies
2218
run: npm install
@@ -36,8 +32,8 @@ jobs:
3632
env:
3733
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3834
run: |
39-
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/toothlessdev/toothlessdev.github.io.git
35+
git config user.name "github-actions"
36+
git config user.email "toothlessdev@users.noreply.github.com"
4037
git add .
41-
git commit -m "Deploy to GitHub Pages"
42-
git checkout gh-pages
38+
git commit -m "Deploy to GitHub Pages" || echo "No changes to commit"
4339
git push origin gh-pages

0 commit comments

Comments
 (0)