Skip to content

Commit

Permalink
Merge pull request #436 from IBM/issue-435
Browse files Browse the repository at this point in the history
add automation to support the automatic generation of the website #435
  • Loading branch information
lmsurpre committed Nov 21, 2019
2 parents d0118a2 + e05fe56 commit 05a52f5
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 3 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Docs and Site

on:
push:
paths:
- "docs/**"
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- name: Grab the Master Branch
uses: actions/checkout@v1
with:
working-directory: fhir
ref: refs/heads/master
fetch-depth: 1
path: fhir
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Build Site
run: |
echo "Check on Path"
pwd
cd docs/
npm install -g gatsby-cli
gatsby telemetry --disable
# Install the packages
# fsevents is not used on linux images, so use --no-optional (these plugins are suspect)
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
# make sure yarn is run to avoid this issue with #98123 WEBPACK
# add yarn --verbose to trace issues with yarn
# don't use gatsby build directly per https://github.com/gatsbyjs/gatsby/issues/17557
# use the suggestion as a workaround due to path/issues in the gatsby component dependency of fsevents
npm --prefix-paths run build
cp -R public/ ../../public/
- name: Grab the GH Pages Branch
uses: actions/checkout@v1
with:
working-directory: gh-pages
ref: refs/heads/gh-pages
fetch-depth: 1
path: docs
token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and Add GH Pages
run: |
echo "cleaning up the prior files on the branch"
if [ ! -f .nojekyll ]
then
touch .nojekyll
rm -f _config.yml
fi
rm -f *.js webpack.stats.json styles-*.js styles-*.js.map webpack-runtime-*.js.map webpack-runtime-*.js manifest.webmanifest component---*.js* app-*.js*
rm -rf docs/node_modules docs/public docs/.cache
echo "Moving the files around for gh-pages"
cp -Rf ../public/* ./
find .
date > build.txt
git config --global user.email "${{ secrets.GITHUB_ACTOR }}@users.noreply.github.com"
git config --global user.name "Git Hub Site Automation"
git add .
git commit -m "Update to GH-Pages"
- name: Push changes to GH Pages
run: |
echo "Push Changes"
git branch
remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push "${remote_repo}" HEAD:gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
CI: true
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"license": "Apache-2.0",
"scripts": {
"build": "gatsby build",
"build": "gatsby build --prefix-paths",
"dev": "gatsby develop",
"dev:clean": "gatsby clean && gatsby develop",
"serve": "gatsby serve"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/data/nav-items.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
path: /guides/DB2OnCloudSetup
- title: Tips and Tricks
pages:
- path: /TipsAndTricks
- path: /TipsAndTricks
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

import React from 'react';
import ResourceLinks from 'gatsby-theme-carbon/src/components/LeftNav/ResourceLinks';

const links = [
{
title: 'Javadoc',
href: "https://ibm.github.io/FHIR/javadocs/latest/"
},
{
title: 'GitHub: Source',
href: 'https://github.com/IBM/FHIR/',
Expand Down

0 comments on commit 05a52f5

Please sign in to comment.