diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 18409d40..6aa0bde9 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,49 +1,38 @@ -on: - push: - branches: - - main - - master - name: pkgdown - +on: push +# on: +# push: +# branches: [main] +# workflow_dispatch: +permissions: + contents: write jobs: - pkgdown: - runs-on: macOS-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + main: + name: Build and publish website + runs-on: ubuntu-latest + timeout-minutes: 60 steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v1 + - name: Checkout repository + uses: actions/checkout@v3 - - uses: r-lib/actions/setup-pandoc@v1 + - name: Install pandoc + uses: r-lib/actions/setup-pandoc@v2 - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} + - name: Install R + uses: r-lib/actions/setup-r@v2 - - name: Cache R packages - uses: actions/cache@v2 + - name: Install R package dependencies + uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install dependencies - run: | - remotes::install_github("Appsilon/shiny.react") - remotes::install_deps(dependencies = TRUE) - install.packages("pkgdown", type = "binary") - shell: Rscript {0} - - - name: Install package - run: R CMD INSTALL . - - - name: Deploy package - run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" - Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' + extra-packages: any::pkgdown, local::. + + # - name: Configure git + # run: | + # git config user.name "$GITHUB_ACTOR" + # git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + # - name: Build and deploy site + # shell: Rscript {0} + # run: pkgdown::deploy_to_branch(branch = "test/gh-pages") + # env: + # GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}