diff --git a/.github/workflows/document-and-deploy-manual.yml b/.github/workflows/document-and-deploy-manual.yml index 2d7ff78..4c31e38 100644 --- a/.github/workflows/document-and-deploy-manual.yml +++ b/.github/workflows/document-and-deploy-manual.yml @@ -28,6 +28,9 @@ jobs: with: r-version: ${{ github.event.inputs.rversion }} + - name: Set up System Dependencies + uses: r-lib/actions/setup-r-dependencies@v2 + - name: Create documentation run: | R -e " @@ -49,7 +52,7 @@ jobs: git push origin || echo "No changes to commit" - name: Deploy latest from dev - if: ${{ github.ref_name }} == 'dev' + if: github.ref == 'refs/heads/dev' env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} run: | @@ -60,7 +63,7 @@ jobs: rsconnect::deployApp(appName = 'CiteSource_latest', appDir = './inst/shiny-app/CiteSource', forceUpdate = TRUE)" - name: Deploy stable version from main - if: ${{ github.ref_name }} == 'main' || ${{ github.ref_name }} == 'master' + if: github.ref == 'refs/heads/main' run: | R -e " install.packages(c('rsconnect', 'remotes')); @@ -71,7 +74,8 @@ jobs: - name: Create pkgdown run: | R -e " - install.packages('pkgdown'); + install.packages('pkgdown'); + if (!require(CiteSource)) remotes::install_github('ESHackathon/CiteSource', force = TRUE); pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)" - name: Deploy to GitHub pages 🚀 diff --git a/.github/workflows/document-and-deploy.yaml b/.github/workflows/document-and-deploy.yaml index e41eab1..917efa4 100644 --- a/.github/workflows/document-and-deploy.yaml +++ b/.github/workflows/document-and-deploy.yaml @@ -52,28 +52,38 @@ jobs: git commit -m 'Documentation' || echo "No changes to commit" git push origin || echo "No changes to commit" - - name: Deploy latest - if: github.ref == 'refs/heads/dev' (from dev) + - name: Deploy latest (from dev) + if: github.ref == 'refs/heads/dev' env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} run: | R -e " install.packages(c('rsconnect', 'remotes')); bspm::disable(); - remotes::install_github('ESHackathon/CiteSource', force = TRUE); + remotes::install_github('ESHackathon/CiteSource', ref = "dev", force = TRUE); rsconnect::setAccountInfo(name=${{secrets.SHINY_LUKAS_ACCOUNT}}, token=${{secrets.SHINY_LUKAS_TOKEN}}, secret=${{secrets.SHINY_LUKAS_SECRET}}); rsconnect::deployApp(appName = 'CiteSource_latest', appDir = './inst/shiny-app/CiteSource', forceUpdate = TRUE)" - name: Deploy stable version (from main) - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/main' + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} run: | R -e " + install.packages(c('rsconnect', 'remotes')); + bspm::disable(); + remotes::install_github('ESHackathon/CiteSource', force = TRUE); + rsconnect::setAccountInfo(name=${{secrets.SHINY_LUKAS_ACCOUNT}}, token=${{secrets.SHINY_LUKAS_TOKEN}}, secret=${{secrets.SHINY_LUKAS_SECRET}}); rsconnect::deployApp(appName = 'CiteSource', appDir = './inst/shiny-app/CiteSource', forceUpdate = TRUE)" - name: Create pkgdown + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} run: | R -e " install.packages('pkgdown'); + bspm::disable(); + if (!require(CiteSource)) remotes::install_github('ESHackathon/CiteSource', force = TRUE); pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)" - name: Deploy to GitHub pages 🚀