Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a workflow to build and deploy docs site #8126

Merged
merged 5 commits into from May 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/actions/bootstrap
@@ -0,0 +1,7 @@
#!/bin/bash

set -e

gem update --system --no-document
gem update bundler --no-document
bundle install --jobs 4 --retry 3
23 changes: 23 additions & 0 deletions .github/actions/deploy_docs
@@ -0,0 +1,23 @@
#!/bin/bash

set -e

bundle exec jekyll build -s docs -d docs/_site -Vt
cd docs/_site
touch .nojekyll
remote_branch="gh-pages-trial"

echo "Publishing to ${GITHUB_REPOSITORY} on branch ${remote_branch}"
remote_repo="https://x-access-token:${JEKYLL_PAT}@github.com/${GITHUB_REPOSITORY}.git"

git init -q
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -qm "[GH ACTIONS] Build triggered by ${GITHUB_SHA}"

echo ""
git push --force $remote_repo master:$remote_branch

cd ../..
exit 0
20 changes: 20 additions & 0 deletions .github/workflows/deploy_docs.yml
@@ -0,0 +1,20 @@
name: Build and deploy Jekyll documentation site
on:
pull_request:
branches:
- master
ashmaroli marked this conversation as resolved.
Show resolved Hide resolved
jobs:
deploy_docs:
if: "!contains(github.event.commits[0].message, '[ci skip]')"
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: 2.7.x
- name: Set up dependencies
run: bash .github/actions/bootstrap
- name: Build and Deploy
run: bash .github/actions/deploy_docs
env:
JEKYLL_PAT: ${{ secrets.GITHUB_TOKEN }}