From 627d1a1706a7b8645b8627239045144b975a366d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Michonneau?= Date: Fri, 18 Dec 2020 15:26:14 +0100 Subject: [PATCH] deploy from "website" action --- .github/workflows/website.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index f58e9c8..719b39d 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest env: RSPM: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest" - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} defaults: run: shell: bash @@ -82,6 +82,24 @@ jobs: done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "18.04"), sep = "\n")') - run: make site + + - name: Setup Git + if: ${{ steps.check-rmd.outputs.count != 0 }} + run: | + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + git status + + - name: Push site + if: ${{ github.event.push == 'true' && steps.check-rmd.outputs.count != 0 && github.ref == 'refs/head/main' }} + run: | + git checkout --orphan gh-pages + git add . + git commit -m "[GitHub Actions] render website" + git remote -v + git status + git push origin gh-pages + - run: make lesson-check if: always() - run: make lesson-check-all -- 2.30.2