Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
88 lines (79 sloc) 3.01 KB
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 .
find . -iname '*.sh' -delete
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
You can’t perform that action at this time.