|
1 | | -name: Deploy to GitHub Pages |
| 1 | +name: Deploy Portfolio and Study |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [ main ] |
6 | | - paths: |
7 | | - - 'Portfolio/**' |
8 | | - - '.github/workflows/deploy.yml' |
| 5 | + branches: |
| 6 | + - main |
9 | 7 | workflow_dispatch: |
10 | 8 |
|
11 | 9 | 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 |
19 | 11 |
|
20 | 12 | jobs: |
21 | | - build: |
| 13 | + deploy: |
22 | 14 | runs-on: ubuntu-latest |
23 | 15 |
|
24 | | - defaults: |
25 | | - run: |
26 | | - working-directory: ./Portfolio |
27 | | - |
28 | 16 | steps: |
29 | 17 | - name: Checkout |
30 | 18 | uses: actions/checkout@v4 |
31 | 19 |
|
32 | 20 | - name: Setup Node |
33 | 21 | uses: actions/setup-node@v4 |
34 | 22 | with: |
35 | | - node-version: '20' |
| 23 | + node-version: 20 |
36 | 24 |
|
37 | | - - name: Install dependencies |
| 25 | + - name: Install Portfolio dependencies |
| 26 | + working-directory: ./Portfolio |
38 | 27 | run: npm install |
39 | 28 |
|
40 | | - - name: Build |
| 29 | + - name: Build Portfolio |
| 30 | + working-directory: ./Portfolio |
41 | 31 | run: npm run build |
42 | 32 |
|
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 |
45 | 46 | |
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: |
61 | 47 | - 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