Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix publish-docs workflow #669

Merged
merged 17 commits into from
Dec 6, 2023
46 changes: 46 additions & 0 deletions .github/assets/github-pages-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
/>
<title>Platform.Bible API</title>
<style>
body {
font-family: 'Roboto', sans-serif;
margin: 40px;
padding: 20px;
background-color: #fcfcfc;
text-align: center;
}

h1 {
color: #121212;
font-weight: 700;
}

a {
display: inline-block;
margin: 20px 10px;
padding: 10px;
background-color: #a70e13;
color: #fcfcfc;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s ease;
}

a:hover {
background-color: #830c14;
}
</style>
</head>
<body>
<h1>Platform.Bible API</h1>
<a href="papi-components/index.html">Go to papi-components</a>
<a href="papi-dts/index.html">Go to papi-dts</a>
</body>
</html>
34 changes: 19 additions & 15 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ jobs:
publish-docs:
runs-on: ubuntu-latest

strategy:
matrix:
node_version: [18.x]

steps:
- name: Checkout git repo
uses: actions/checkout@v3

- name: Install Node and NPM
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
node-version: 18.x
cache: npm

- name: Install and build
Expand All @@ -29,18 +25,26 @@ jobs:
npm run build
- name: Build documentation
run: | # renaming the folders so that pages links at /{their name} instead of at /docs
cd ~/lib/papi-components
npm run build:docs
mv docs papi-components
cd ~/lib/papi-dts
npm run build:docs
mv docs papi-dts
run: | # need to specify --out so pages links at /{their name} instead of at /docs
cd lib/papi-components
npm run build:docs -- --out papi-components
cd ../papi-dts
npm run build:docs -- --out papi-dts
cd ../../
mkdir docs-for-pages
mv lib/papi-components/papi-components docs-for-pages
mv lib/papi-dts/papi-dts docs-for-pages
- name: Add nojekyll # needed so that HTML pages that start with _ do not cause 404
run: touch docs-for-pages/.nojekyll

- name: Add landing page
run: |
cp .github/assets/github-pages-index.html docs-for-pages
mv docs-for-pages/github-pages-index.html docs-for-pages/index.html
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: github-pages
folder: |
lib/papi-components/papi-components
lib/papi-dts/papi-dts
folder: docs-for-pages
2 changes: 1 addition & 1 deletion lib/papi-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"scripts": {
"start": "vite --host --open",
"build:basic": "tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts",
"build:docs": "npx typedoc",
"build:docs": "typedoc",
"build": "npm run build:basic && npm run lint-fix",
"watch": "tsc && vite build --watch",
"lint": "npm run lint:scripts && npm run lint:styles",
Expand Down
6 changes: 3 additions & 3 deletions lib/papi-components/typedoc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"entryPoints": ["src"],
"entryPointStrategy": "expand",
"exclude": ["src/index.ts"],
"entryPoints": ["src/index.ts"],
"out": "docs",
"tsconfig": "tsconfig.json",
"sort": ["kind", "alphabetical"],
"kindSortOrder": ["Function"]
}
2 changes: 1 addition & 1 deletion lib/papi-dts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"main": "",
"types": "papi.d.ts",
"scripts": {
"build:docs": "npx typedoc",
"build:docs": "typedoc",
"build": "tsc && prettier --write papi.d.ts && ts-node edit-papi-d-ts.ts",
"build:clean": "rimraf papi.tsbuildinfo",
"build:fresh": "npm run build:clean && npm run build",
Expand Down