Skip to content

Commit 05a52f5

Browse files
authored
Merge pull request #436 from IBM/issue-435
add automation to support the automatic generation of the website #435
2 parents d0118a2 + e05fe56 commit 05a52f5

4 files changed

Lines changed: 93 additions & 3 deletions

File tree

.github/workflows/site.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Docs and Site
2+
3+
on:
4+
push:
5+
paths:
6+
- "docs/**"
7+
branches:
8+
- master
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [12.x]
17+
18+
steps:
19+
- name: Grab the Master Branch
20+
uses: actions/checkout@v1
21+
with:
22+
working-directory: fhir
23+
ref: refs/heads/master
24+
fetch-depth: 1
25+
path: fhir
26+
- name: Use Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v1
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
- name: Build Site
31+
run: |
32+
echo "Check on Path"
33+
pwd
34+
cd docs/
35+
npm install -g gatsby-cli
36+
gatsby telemetry --disable
37+
38+
# Install the packages
39+
# fsevents is not used on linux images, so use --no-optional (these plugins are suspect)
40+
npm install --no-optional --save react react-copy-to-clipboard react-dom react-ga classnames carbon @carbon/addons-website carbon-components carbon-components-react carbon-addons-cloud carbon-icons gatsby gatsby-theme-carbon-starter markdown-it gatsby-plugin-manifest gatsby-plugin-slug gatsby-plugin-sitemap gatsby-plugin-sharp
41+
42+
# make sure yarn is run to avoid this issue with #98123 WEBPACK
43+
# add yarn --verbose to trace issues with yarn
44+
45+
# don't use gatsby build directly per https://github.com/gatsbyjs/gatsby/issues/17557
46+
# use the suggestion as a workaround due to path/issues in the gatsby component dependency of fsevents
47+
npm --prefix-paths run build
48+
cp -R public/ ../../public/
49+
- name: Grab the GH Pages Branch
50+
uses: actions/checkout@v1
51+
with:
52+
working-directory: gh-pages
53+
ref: refs/heads/gh-pages
54+
fetch-depth: 1
55+
path: docs
56+
token: ${{ secrets.GITHUB_TOKEN }}
57+
- name: Commit and Add GH Pages
58+
run: |
59+
echo "cleaning up the prior files on the branch"
60+
if [ ! -f .nojekyll ]
61+
then
62+
touch .nojekyll
63+
rm -f _config.yml
64+
fi
65+
66+
rm -f *.js webpack.stats.json styles-*.js styles-*.js.map webpack-runtime-*.js.map webpack-runtime-*.js manifest.webmanifest component---*.js* app-*.js*
67+
rm -rf docs/node_modules docs/public docs/.cache
68+
69+
echo "Moving the files around for gh-pages"
70+
cp -Rf ../public/* ./
71+
find .
72+
date > build.txt
73+
git config --global user.email "${{ secrets.GITHUB_ACTOR }}@users.noreply.github.com"
74+
git config --global user.name "Git Hub Site Automation"
75+
git add .
76+
git commit -m "Update to GH-Pages"
77+
- name: Push changes to GH Pages
78+
run: |
79+
echo "Push Changes"
80+
git branch
81+
remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
82+
git push "${remote_repo}" HEAD:gh-pages
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
86+
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
87+
CI: true

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"license": "Apache-2.0",
55
"scripts": {
6-
"build": "gatsby build",
6+
"build": "gatsby build --prefix-paths",
77
"dev": "gatsby develop",
88
"dev:clean": "gatsby clean && gatsby develop",
99
"serve": "gatsby serve"

docs/src/data/nav-items.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
path: /guides/DB2OnCloudSetup
2323
- title: Tips and Tricks
2424
pages:
25-
- path: /TipsAndTricks
25+
- path: /TipsAndTricks

docs/src/gatsby-theme-carbon/components/LeftNav/ResourceLinks.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
import React from 'react';
88
import ResourceLinks from 'gatsby-theme-carbon/src/components/LeftNav/ResourceLinks';
9-
109
const links = [
10+
{
11+
title: 'Javadoc',
12+
href: "https://ibm.github.io/FHIR/javadocs/latest/"
13+
},
1114
{
1215
title: 'GitHub: Source',
1316
href: 'https://github.com/IBM/FHIR/',

0 commit comments

Comments
 (0)