|
1 | | -name: Deploy GitHub Pages |
| 1 | +name: Deploy Vite React App to GitHub Pages |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: [ "main", "master" ] |
6 | | - pull_request: |
7 | | - branches: [ "main", "master" ] |
8 | | - |
9 | | - # Allows you to run this workflow manually from the Actions tab |
10 | 6 | workflow_dispatch: |
11 | 7 |
|
12 | | -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
13 | 8 | permissions: |
14 | 9 | contents: read |
15 | 10 | pages: write |
16 | 11 | id-token: write |
17 | 12 |
|
18 | | -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
19 | | -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
20 | 13 | concurrency: |
21 | 14 | group: "pages" |
22 | 15 | cancel-in-progress: false |
23 | 16 |
|
24 | 17 | jobs: |
25 | | - # Build job |
26 | 18 | build: |
27 | 19 | runs-on: ubuntu-latest |
28 | 20 | steps: |
29 | 21 | - name: Checkout |
30 | 22 | uses: actions/checkout@v4 |
31 | | - |
| 23 | + |
| 24 | + - name: Setup Node.js |
| 25 | + uses: actions/setup-node@v4 |
| 26 | + with: |
| 27 | + node-version: '18' |
| 28 | + cache: 'npm' |
| 29 | + cache-dependency-path: './spring-scribe-shine-main/package-lock.json' |
| 30 | + |
| 31 | + - name: Install dependencies |
| 32 | + run: | |
| 33 | + cd spring-scribe-shine-main |
| 34 | + npm ci |
| 35 | +
|
| 36 | + - name: Build |
| 37 | + run: | |
| 38 | + cd spring-scribe-shine-main |
| 39 | + npm run build |
| 40 | +
|
32 | 41 | - name: Setup Pages |
33 | 42 | uses: actions/configure-pages@v4 |
34 | | - |
35 | | - - name: Build with Jekyll |
36 | | - uses: actions/jekyll-build-pages@v1 |
37 | | - with: |
38 | | - source: ./ |
39 | | - destination: ./_site |
40 | | - |
| 43 | + |
41 | 44 | - name: Upload artifact |
42 | 45 | uses: actions/upload-pages-artifact@v3 |
| 46 | + with: |
| 47 | + path: './spring-scribe-shine-main/dist' |
43 | 48 |
|
44 | | - # Deployment job |
45 | 49 | deploy: |
46 | 50 | environment: |
47 | 51 | name: github-pages |
|
52 | 56 | - name: Deploy to GitHub Pages |
53 | 57 | id: deployment |
54 | 58 | uses: actions/deploy-pages@v4 |
| 59 | + steps: |
| 60 | + - name: Deploy to GitHub Pages |
| 61 | + id: deployment |
| 62 | + uses: actions/deploy-pages@v4 |
0 commit comments