-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 1.96 KB
/
gh-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Tutorial: https://dev.to/devloker/deploy-a-react-projects-that-are-inside-a-subdirectories-to-github-pages-using-github-actions-cicd-3n9l
name: Deploy to GitHub Pages
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: latest
# index page
- name: Deploy index page
run: |
mkdir -p deploy
cp -r index.html style.css 1-digital-business-card/screenshot.png 2-travel-journal/screenshot.png 3-quizzical/screenshot-start.png 3-quizzical/screenshot-questions.png 3-quizzical/screenshot-answers.png deploy/
# digital-business-card project
- name: Build digital-business-card
run: |
cd 1-digital-business-card
npm install && npm run build
cd ..
mkdir -p deploy/1-digital-business-card
cp -r 1-digital-business-card/dist/* deploy/1-digital-business-card/
# travel-journal project
- name: Build travel-journal
run: |
cd 2-travel-journal
npm install && npm run build
cd ..
mkdir -p deploy/2-travel-journal
cp -r 2-travel-journal/dist/* deploy/2-travel-journal/
# quizzical project
- name: Build quizzical
run: |
cd 3-quizzical
npm install && npm run build
cd ..
mkdir -p deploy/3-quizzical
cp -r 3-quizzical/dist/* deploy/3-quizzical/
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./deploy"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4