From 8edf902a104b9ffd7bc393da208a2558ce22cf42 Mon Sep 17 00:00:00 2001 From: Kari Lavikka Date: Tue, 14 Jan 2025 15:21:51 +0200 Subject: [PATCH] add github action --- .github/build-and-deploy-vignette.yaml | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/build-and-deploy-vignette.yaml diff --git a/.github/build-and-deploy-vignette.yaml b/.github/build-and-deploy-vignette.yaml new file mode 100644 index 0000000..8dd4c89 --- /dev/null +++ b/.github/build-and-deploy-vignette.yaml @@ -0,0 +1,43 @@ +name: Build and Deploy Vignette + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up R + uses: r-lib/actions/setup-r@v2 + + - name: Install dependencies + run: | + install.packages('devtools') + devtools::install_deps(dependencies = TRUE) + + - name: Build vignette + run: | + R -e 'rmarkdown::render("vignettes/introduction.Rmd", output_file = "docs/introduction.html")' + echo 'Jellyfisher Vignettes

Jellyfisher Vignettes

' > docs/index.html + + deploy: + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Deploy to gh-pages branch + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs + publish_branch: gh-pages