Merge pull request #49 from cgrdn/master #119
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
name: Render & Deploy Site | |
jobs: | |
build: | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Set up python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install python dependencies | |
run: | | |
pip install pandas | |
pip install seaborn | |
pip install git+http://github.com/euroargodev/argopy.git@master | |
- name: Install R dependencies | |
run: | | |
install.packages("distill") | |
install.packages("reticulate") | |
install.packages("leaflet") | |
shell: Rscript {0} | |
- name: Render site | |
run: | | |
rmarkdown::render_site(encoding = "UTF-8") | |
shell: Rscript {0} | |
- name: Checkout the gh-pages branch | |
if: success() && (github.ref == 'refs/heads/master') | |
uses: actions/checkout@master | |
with: | |
ref: gh-pages | |
path: pages-clone | |
- name: Deploy site to the gh-pages branch | |
if: success() && (github.ref == 'refs/heads/master') | |
run: | | |
cp -rf docs/* pages-clone/ | |
cd pages-clone | |
git add -A | |
git commit -m 'Rebuild site' || echo "No changes to commit" | |
git push origin || echo "No changes to commit" |