Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/PecanProject/pecan into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
araiho committed Jul 10, 2020
2 parents bf4e1fd + cf40495 commit 7406883
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
on:
push:
branches:
- master
- develop
- release/*
tags:
- v1
- v1*

# render book
name: renderbook

jobs:
bookdown:
name: Render-Book
runs-on: ubuntu-latest
container: pecan/base:latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
- name: Install rmarkdown
run: Rscript -e 'install.packages(c("rmarkdown","bookdown"))'
- name: Render Book
run: cd book_source && Rscript -e 'options(bookdown.render.file_scope=FALSE); bookdown::render_book("index.Rmd")'
- uses: actions/upload-artifact@v2
with:
name: _book
path: book_source/_book/


checkout-and-deploy:
runs-on: ubuntu-latest
needs: bookdown
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
# Artifact name
name: _book # optional
# Destination path
path: _book/ # optional
# repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout documentation repo
uses: actions/checkout@v2
with:
repository: ${{ github.repository_owner }}/pecan-documentation
path: pecan-documentation
token: ${{ secrets.GH_PAT }}
- run: |
export VERSION=${GITHUB_REF##*/}_test
cd pecan-documentation && mkdir -p $VERSION
git config --global user.email "[email protected]"
git config --global user.name "GitHub Documentation Robot"
rsync -a --delete ../_book/ $VERSION
git add --all *
git commit -m "Build book from pecan revision $GITHUB_SHA" || true
git push -q origin master

0 comments on commit 7406883

Please sign in to comment.