-
Notifications
You must be signed in to change notification settings - Fork 39
75 lines (64 loc) · 2.4 KB
/
Copy pathdeploy-ui-docs.yml
File metadata and controls
75 lines (64 loc) · 2.4 KB
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
72
73
74
name: Build and Deploy UI Docs
on:
push:
branches:
- main
paths:
- 'projects/orcid-ui-docs/**'
- 'projects/orcid-ui/**'
- 'projects/orcid-tokens/**'
- 'package.json'
- 'angular.json'
- '.github/workflows/deploy-ui-docs.yml'
workflow_dispatch:
# Allows manual triggering via GitHub CLI or GitHub UI
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build orcid-ui-docs
run: yarn build:ui-docs --base-href /orcid-angular/
continue-on-error: false
- name: Determine build output directory
id: set-output
run: |
if [ -d "dist/orcid-ui-docs/browser" ]; then
echo "directory=dist/orcid-ui-docs/browser" >> "$GITHUB_OUTPUT"
elif [ -d "dist/orcid-ui-docs" ]; then
echo "directory=dist/orcid-ui-docs" >> "$GITHUB_OUTPUT"
else
echo "ERROR: Build output directory not found" >&2
ls -la dist/ >&2
exit 1
fi
- name: Setup SPA support for GitHub Pages
run: |
BUILD_DIR="${{ steps.set-output.outputs.directory }}"
# Copy index.html to 404.html for SPA routing support
# This 404.html will handle routes within THIS specific SPA
cp "$BUILD_DIR/index.html" "$BUILD_DIR/404.html"
# Note: .nojekyll is already in the repo root and will be preserved
echo "✅ SPA support configured: 404.html created for root deployment"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ steps.set-output.outputs.directory }}
destination_dir: . # Deploy to root for main branch
keep_files: true # Keep PR preview deployments in /runway/* and .nojekyll
exclude_assets: '.nojekyll' # Don't delete the .nojekyll file
cname: false