From 45edf27014381fa3f6671222b4e9a39574011ab3 Mon Sep 17 00:00:00 2001 From: Jacob Long Date: Sun, 28 Jul 2024 13:25:23 -0400 Subject: [PATCH] Reverting change to website deployment --- .github/workflows/pkgdown.yaml | 43 +++++++++++++++++++++++++++------- README.md | 2 -- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index c9f0165..6905849 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -3,6 +3,7 @@ on: push: branches: [main, master] + tags: ['*'] pull_request: branches: [main, master] release: @@ -37,14 +38,38 @@ jobs: extra-packages: any::pkgdown, local::. needs: website - - name: Build site - run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + - name: Install package + run: R CMD INSTALL . + + - name: Build and deploy pkgdown site + if: contains(env.isPush, 'true') + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' + - name: Create website + if: contains(env.isPush, 'false') + run: | + pkgdown::build_site() shell: Rscript {0} - - - name: Deploy to GitHub pages 🚀 - if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.5.0 + + - name: Create index file + if: contains(env.isPush, 'false') + run: | + echo ' ' > ./docs/index.html + - name: Deploy to Netlify + if: contains(env.isPush, 'false') + id: netlify-deploy + uses: nwtgck/actions-netlify@v1.1 with: - clean: false - branch: gh-pages - folder: docs + publish-dir: './docs' + production-branch: master + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: + 'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})' + # these all default to 'true' + enable-pull-request-comment: false + enable-commit-comment: false + # enable-commit-status: true + #o verwrites-pull-request-comment: true + timeout-minutes: 1 diff --git a/README.md b/README.md index baaba84..4b5695a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ - ## Warning: le package 'jtools' a été compilé avec la version R 4.3.3 - # interactions interactions