Skip to content

Commit 6524a64

Browse files
committed
fix(ci): deploy main site combined with cdd-web-ui
1 parent 5857255 commit 6524a64

1 file changed

Lines changed: 21 additions & 17 deletions

File tree

.github/workflows/deploy-cdd-web-ui.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Web UI to GitHub Pages
22

33
on:
44
push:
5-
branches: ['main', 'master']
5+
branches: [main, master]
66
workflow_dispatch:
77

88
permissions:
@@ -17,28 +17,33 @@ jobs:
1717
build:
1818
runs-on: ubuntu-latest
1919
steps:
20+
- name: Checkout main site (offscale.github.io)
21+
uses: actions/checkout@v4
22+
with:
23+
path: main-site
24+
2025
- name: Checkout cdd-web-ui
2126
uses: actions/checkout@v4
2227
with:
23-
repository: 'SamuelMarks/cdd-web-ui'
24-
path: 'cdd-web-ui'
28+
repository: SamuelMarks/cdd-web-ui
29+
path: cdd-web-ui
2530

2631
- name: Checkout cdd-docs-ui
2732
uses: actions/checkout@v4
2833
with:
29-
repository: 'SamuelMarks/cdd-docs-ui'
30-
path: 'cdd-docs-ui'
34+
repository: SamuelMarks/cdd-docs-ui
35+
path: cdd-docs-ui
3136

3237
- name: Checkout cdd-ctl
3338
uses: actions/checkout@v4
3439
with:
35-
repository: 'SamuelMarks/cdd-ctl'
36-
path: 'cdd-ctl'
40+
repository: SamuelMarks/cdd-ctl
41+
path: cdd-ctl
3742

3843
- name: Setup Node.js
3944
uses: actions/setup-node@v4
4045
with:
41-
node-version: '20'
46+
node-version: 20
4247

4348
- name: Install Binaryen
4449
run: sudo apt-get update && sudo apt-get install -y binaryen
@@ -81,22 +86,21 @@ jobs:
8186
- name: Compute base-href and Build Angular App
8287
working-directory: ./cdd-web-ui
8388
run: |
84-
BASE_PATH=$(echo $DEPLOY_LOCATION | sed -e 's/^[^\/]*//')
85-
if [ -z "$BASE_PATH" ] || [ "$BASE_PATH" == "/" ]; then
86-
BASE_HREF="/"
87-
else
88-
BASE_HREF="$BASE_PATH/"
89-
fi
90-
echo "Building Angular with --base-href=$BASE_HREF"
91-
npx ng build --configuration production --base-href $BASE_HREF
89+
echo "Building Angular with --base-href=/cdd-web-ui/"
90+
npx ng build --configuration production --base-href /cdd-web-ui/
91+
92+
- name: Combine Site Artifacts
93+
run: |
94+
rm -rf main-site/cdd-web-ui
95+
cp -r cdd-web-ui/dist/cdd-web-ui/browser main-site/cdd-web-ui
9296
9397
- name: Setup Pages
9498
uses: actions/configure-pages@v4
9599

96100
- name: Upload artifact
97101
uses: actions/upload-pages-artifact@v3
98102
with:
99-
path: './cdd-web-ui/dist/cdd-web-ui/browser'
103+
path: ./main-site
100104

101105
deploy:
102106
needs: build

0 commit comments

Comments
 (0)