Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
tuner committed Jan 14, 2025
1 parent 63135d5 commit 8edf902
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/build-and-deploy-vignette.yaml
Original file line number Diff line number Diff line change
@@ -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 '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Jellyfisher Vignettes</title></head><body><h1>Jellyfisher Vignettes</h1><ul><li><a href="docs/introduction.html">Introduction</a></li></ul></body></html>' > 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

0 comments on commit 8edf902

Please sign in to comment.