Skip to content

Commit e1af3ff

Browse files
committed
fix deployment
1 parent a88183f commit e1af3ff

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

.github/workflows/deploy.yaml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,30 @@
11
name: Deploy to GitHub Pages
22

33
on:
4-
pull_request:
5-
branches: [main]
64
push:
7-
branches: [main]
5+
branches:
6+
- main
87

98
jobs:
10-
test-deploy:
11-
if: github.event_name != 'push'
9+
deploy:
10+
name: Deploy to GitHub Pages
1211
runs-on: ubuntu-latest
1312
steps:
1413
- uses: actions/checkout@v3
1514
- uses: actions/setup-node@v3
1615
with:
1716
node-version: 16
1817
cache: yarn
18+
1919
- name: Install dependencies
20-
run: yarn install
21-
- name: Test build website
20+
run: yarn install --frozen-lockfile
21+
- name: Build website
2222
run: yarn build
23-
deploy:
24-
if: github.event_name != 'pull_request'
25-
runs-on: ubuntu-latest
26-
steps:
27-
- uses: actions/checkout@v3
28-
- uses: actions/setup-node@v3
29-
with:
30-
node-version: 16
31-
cache: yarn
32-
- uses: webfactory/ssh-agent@v0.5.0
33-
with:
34-
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
23+
3524
- name: Deploy to GitHub Pages
36-
env:
37-
USE_SSH: true
38-
run: |
39-
git config --global user.name "fullstack-devops[bot]"
40-
git config --global user.email "fullstack-devops[bot]@users.noreply.github.com"
41-
yarn install
42-
yarn deploy
25+
uses: peaceiris/actions-gh-pages@v3
26+
with:
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
publish_dir: ./build
29+
user_name: fullstack-devops[bot]
30+
user_email: fullstack-devops[bot]@users.noreply.github.com

.github/workflows/test-deploy.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test deployment
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test-deploy:
10+
name: Test deployment
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 16
17+
cache: yarn
18+
19+
- name: Install dependencies
20+
run: yarn install --frozen-lockfile
21+
- name: Test build website
22+
run: yarn build

0 commit comments

Comments
 (0)