-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #436 from IBM/issue-435
add automation to support the automatic generation of the website #435
- Loading branch information
Showing
4 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ | |
path: /guides/DB2OnCloudSetup | ||
- title: Tips and Tricks | ||
pages: | ||
- path: /TipsAndTricks | ||
- path: /TipsAndTricks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters