Skip to content

Update committer info #199

Update committer info

Update committer info #199

# Adapted from https://github.com/limjh16/jekyll-action-ts
name: Build and deploy to GH Pages
on:
push:
branches:
- main-gh-pages
jobs:
build-gh-pages:
runs-on: ubuntu-latest
steps:
- name: "📂 Checkout branch"
uses: actions/checkout@v2
with:
# Needed for Hugo themes (e.g., __task_trees/themes)
submodules: true
# include the lines below if you are using jekyll-last-modified-at
# or if you would otherwise need to fetch the full commit history
# however this may be very slow for large repositories!
# with:
# fetch-depth: '0'
- name: "Install Graphviz (for jekyll-graphviz)"
uses: ts-graphviz/setup-graphviz@v1
- name: "Setup ruby (to run Jekyll)"
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.3
# ----- Install various dependencies for https://github.com/zhustec/jekyll-diagrams
# Java is needed for plantuml, but it seems to be working without needing to install Java explicitly
# - name: "Setup Java"
# uses: actions/setup-java@v2
# with:
# distribution: 'zulu'
# java-version: '11'
# Also provides node12, which is needed by mermaid
# node12 is also used by https://github.com/limjh16/jekyll-action-ts/blob/master/action.yml#L32
# node is needed by mermaid and is provided by ts-graphviz, so don't need to explicitly setup-node
# - name: Install Node 12
# uses: actions/setup-node@v2
# with:
# node-version: '12'
# cache: 'npm'
# cache-dependency-path: package-lock.json
# - name: 'Install Node diagramming tools'
# run: |
# npm install
# - name: Add node packages to path
# run: |
# echo "$PWD/node_modules/.bin" >> $GITHUB_PATH
# - name: "Setup Python"
# uses: actions/setup-python@v2
# with:
# python-version: '3.x'
# - name: "Install Python diagramming tools"
# uses: BSFishy/pip-action@v1
# with:
# packages: |
# blockdiag
# seqdiag
# nwdiag
- name: "🔨 Build Jekyll site"
uses: limjh16/jekyll-action-ts@v2
with:
### Enables caching. Similar to https://github.com/actions/cache.
enable_cache: true
### Uses prettier https://prettier.io to format jekyll output HTML.
format_output: true
### Sets prettier options (in JSON) to format output HTML. For example, output tabs over spaces.
### Possible options are outlined in https://prettier.io/docs/en/options.html
# prettier_opts: '{ "useTabs": true }'
### If the jekyll website source is not in root, specify the directory.
jekyll_src: .
### In cases where you want to specify the cache key
### Follows the format here https://github.com/actions/cache
# key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
# restore-keys: ${{ runner.os }}-gems-
### If you need to specify any Jekyll build options, enable the above input
### Flags accepted can be found here https://jekyllrb.com/docs/configuration/options/#build-command-options
# custom_opts: '--drafts --future --verbose'
custom_opts: '--profile'
- name: "📂 Checkout Caseflow code (for task_trees subsite)"
uses: actions/checkout@v2
with:
ref: "master"
path: "__tmp_caseflow_checkout"
- name: "✏️ Update task_trees subsite with Caseflow code comments"
env:
WIKI_COMMIT_MESSAGE: '`comments_to_descriptions.py` - automatic update of task_trees docs with Caseflow code comments'
WIKI_COMMIT_USER_EMAIL: 'Quillman_Samantha@bah.com'
WIKI_COMMIT_USER_NAME: 'samantha-quillman'
run: |
MY_HOME=`pwd`
cd __task_trees/content/trees
./comments_to_descriptions.py "$MY_HOME/__tmp_caseflow_checkout"
# Check in changes to main-gh-pages
git add .
if git diff-index --quiet HEAD; then
echo "::group::No changes to schema"
ls -alR task_descr
echo "::endgroup::"
else
echo "::group::Pushing changes to main-gh-pages"
git config --local user.email "$WIKI_COMMIT_USER_EMAIL"
git config --local user.name "$WIKI_COMMIT_USER_NAME"
git commit -m "$WIKI_COMMIT_MESSAGE" && git push
echo "::endgroup::"
fi
- name: "🔨 Build subsites"
run: |
# README.md for https://github.com/department-of-veterans-affairs/caseflow/tree/gh-pages
cp README.md _site/
make build_subsites
- name: "🚀 Deploy to gh-pages branch"
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
# if the repo you are deploying to is <username>.github.io, uncomment the line below.
# if you are including the line below, make sure your source files are NOT in the master branch:
publish_branch: gh-pages
commit_message: ${{ github.event.head_commit.message }}