File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and deploy Documentation site
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ env :
9+ RUBY_VERSION : 2.7
10+
11+ # For control over build environment
12+ DOCS_DEPLOY : true
13+
14+ jobs :
15+ deploy_docs :
16+ runs-on : " ubuntu-latest"
17+ env :
18+ BUNDLE_PATH : " vendor/bundle"
19+ steps :
20+ - uses : actions/checkout@v3
21+ - uses : ruby/setup-ruby@v1
22+ with :
23+ ruby-version : ${{ env.RUBY_VERSION }}
24+ bundler-cache : true
25+ - name : Clone target branch
26+ run : |
27+ REMOTE_BRANCH="${REMOTE_BRANCH:-gh-pages}"
28+ REMOTE_REPO="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
29+
30+ echo "Publishing to ${GITHUB_REPOSITORY} on branch ${REMOTE_BRANCH}"
31+ rm -rf docs/_site/
32+ git clone --depth=1 --branch="${REMOTE_BRANCH}" --single-branch --no-checkout \
33+ "${REMOTE_REPO}" docs/_site/
34+ - name : Build site
35+ run : bundle exec jekyll build --source docs --destination docs/_site --verbose --trace
36+ - name : Deploy to GitHub Pages
37+ run : |
38+ SOURCE_COMMIT="$(git log -1 --pretty="%an: %B" "$GITHUB_SHA")"
39+ pushd docs/_site &>/dev/null
40+ : > .nojekyll
41+
42+ git add --all
43+ git -c user.name="${GITHUB_ACTOR}" -c user.email="${GITHUB_ACTOR}@users.noreply.github.com" \
44+ commit --quiet \
45+ --message "Deploy docs from ${GITHUB_SHA}" \
46+ --message "$SOURCE_COMMIT"
47+ git push
48+
49+ popd &>/dev/null
You can’t perform that action at this time.
0 commit comments