Skip to content

Commit fedcbf9

Browse files
committed
add new workflow
1 parent 3dbc314 commit fedcbf9

File tree

2 files changed

+30
-85
lines changed

2 files changed

+30
-85
lines changed

.github/workflows/deploy-study.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,54 @@
1-
name: Deploy to GitHub Pages
1+
name: Deploy Portfolio and Study
22

33
on:
44
push:
5-
branches: [ main ]
6-
paths:
7-
- 'Portfolio/**'
8-
- '.github/workflows/deploy.yml'
5+
branches:
6+
- main
97
workflow_dispatch:
108

119
permissions:
12-
contents: read
13-
pages: write
14-
id-token: write
15-
16-
concurrency:
17-
group: "pages"
18-
cancel-in-progress: false
10+
contents: write
1911

2012
jobs:
21-
build:
13+
deploy:
2214
runs-on: ubuntu-latest
2315

24-
defaults:
25-
run:
26-
working-directory: ./Portfolio
27-
2816
steps:
2917
- name: Checkout
3018
uses: actions/checkout@v4
3119

3220
- name: Setup Node
3321
uses: actions/setup-node@v4
3422
with:
35-
node-version: '20'
23+
node-version: 20
3624

37-
- name: Install dependencies
25+
- name: Install Portfolio dependencies
26+
working-directory: ./Portfolio
3827
run: npm install
3928

40-
- name: Build
29+
- name: Build Portfolio
30+
working-directory: ./Portfolio
4131
run: npm run build
4232

43-
- name: Setup Pages
44-
uses: actions/configure-pages@v4
33+
- name: Install Study dependencies
34+
working-directory: ./study
35+
run: npm install
36+
37+
- name: Build Study
38+
working-directory: ./study
39+
run: npm run build
40+
41+
- name: Prepare deployment
42+
run: |
43+
mkdir -p deploy
44+
cp -r Portfolio/dist/* deploy/
45+
cp -r study/build deploy/study
4546
46-
- name: Upload artifact
47-
uses: actions/upload-pages-artifact@v3
48-
with:
49-
path: './Portfolio/dist'
50-
51-
deploy:
52-
runs-on: ubuntu-latest
53-
needs: build
54-
permissions:
55-
pages: write
56-
id-token: write
57-
environment:
58-
name: github-pages
59-
url: ${{ steps.deployment.outputs.page_url }}
60-
steps:
6147
- name: Deploy to GitHub Pages
62-
id: deployment
63-
uses: actions/deploy-pages@v4
48+
uses: peaceiris/actions-gh-pages@v3
49+
with:
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
publish_dir: ./deploy
52+
publish_branch: gh-pages
53+
user_name: 'github-actions[bot]'
54+
user_email: 'github-actions[bot]@users.noreply.github.com'

0 commit comments

Comments
 (0)