deploy R-based lessons without using another action
authorFrançois Michonneau <francois.michonneau@gmail.com>
Fri, 18 Dec 2020 16:02:33 +0000 (17:02 +0100)
committerFrançois Michonneau <francois.michonneau@gmail.com>
Wed, 6 Jan 2021 14:22:46 +0000 (15:22 +0100)
.github/workflows/website.yml

index 719b39dbfea94569d3d60b236fdc2cac1f6a7c7f..7b090b129e52ed8994f9697d12ba5db398ca238d 100644 (file)
@@ -1,7 +1,9 @@
 name: Website
 on:
   push:
-    branches: gh-pages
+    branches:
+      - gh-pages
+      - main
   pull_request: []
 jobs:
   build-website:
@@ -88,17 +90,15 @@ jobs:
         run: |
           git config --local user.email "actions@github.com"
           git config --local user.name "GitHub Actions"
-          git status
+          git checkout --orphan gha-rendering
 
       - name: Push site
-        if: ${{ github.event.push == 'true' && steps.check-rmd.outputs.count != 0 && github.ref == 'refs/head/main' }}
+        if: ${{ github.event.push == 'true' && steps.check-rmd.outputs.count != 0 && github.ref == 'refs/heads/main' }}
         run: |
-          git checkout --orphan gh-pages
-          git add .
+          rm -rf .bundle
+          git add --force .
           git commit -m "[GitHub Actions] render website"
-          git remote -v
-          git status
-          git push origin gh-pages
+          git push --force origin +gha-rendering:gh-pages
 
       - run: make lesson-check
         if: always()