From a8f1496503d5ca5d6f77400bbeadf18bf2419355 Mon Sep 17 00:00:00 2001 From: nfrerebeau Date: Tue, 13 Aug 2024 14:23:34 +0200 Subject: [PATCH] Build only released pkgdown websites --- .github/workflows/render.yaml | 45 +++++++++++++++++++--------------- config.json | 46 ----------------------------------- 2 files changed, 26 insertions(+), 65 deletions(-) delete mode 100644 config.json diff --git a/.github/workflows/render.yaml b/.github/workflows/render.yaml index e7240ef6b..600908a4a 100644 --- a/.github/workflows/render.yaml +++ b/.github/workflows/render.yaml @@ -10,22 +10,26 @@ on: name: Build website jobs: - configure: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.packages.outputs.matrix }} - steps: - - uses: actions/checkout@v4 - - - id: packages - run: echo "matrix=$(jq -c . < ./config.json)" >> $GITHUB_OUTPUT - pkgdown: runs-on: ubuntu-latest - needs: configure strategy: fail-fast: false - matrix: ${{ fromJson(needs.configure.outputs.matrix) }} + matrix: + config: + - {pkg: 'aion'} + - {pkg: 'alkahest'} + - {pkg: 'ananke'} + - {pkg: 'arkhe'} + - {pkg: 'dimensio'} + - {pkg: 'folio'} + - {pkg: 'isopleuros'} + - {pkg: 'kairos'} + - {pkg: 'khroma'} + - {pkg: 'kinesis'} + - {pkg: 'nexus'} + - {pkg: 'tabula'} + - {pkg: 'tekton'} + - {pkg: 'tesselle'} steps: - uses: actions/checkout@v4 @@ -41,17 +45,20 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::pkgdown, any::devtools, any::tekton + extra-packages: any::pkgdown, any::remotes, any::tekton - - name: Build site + - name: Build site (latest release) run: | - git clone https://github.com/tesselle/${{ matrix.name }} tmp - Rscript -e 'devtools::install(pkg = "tmp", dependencies = TRUE)' - Rscript -e 'pkgdown::build_site_github_pages(pkg = "tmp", dest_dir = "docs")' + git clone https://github.com/tesselle/${{ matrix.config.pkg }} tmp + cd tmp/ + git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) + Rscript -e 'remotes::install_deps(pkgdir = ".", dependencies = TRUE)' + Rscript -e 'utils::install.packages(pkgs = ".", repos = NULL)' + Rscript -e 'pkgdown::build_site_github_pages(pkg = ".", dest_dir = "docs")' - uses: actions/upload-artifact@v4 with: - name: ${{ matrix.name }} + name: ${{ matrix.config.pkg }} path: tmp/docs quarto: @@ -82,6 +89,6 @@ jobs: if: github.event_name != 'pull_request' uses: JamesIves/github-pages-deploy-action@v4.6.0 with: - clean: false + clean: true branch: gh-pages folder: _site diff --git a/config.json b/config.json deleted file mode 100644 index f63a28909..000000000 --- a/config.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "include": [ - { - "name": "aion" - }, - { - "name": "alkahest" - }, - { - "name": "ananke" - }, - { - "name": "arkhe" - }, - { - "name": "dimensio" - }, - { - "name": "folio" - }, - { - "name": "isopleuros" - }, - { - "name": "kairos" - }, - { - "name": "khroma" - }, - { - "name": "kinesis" - }, - { - "name": "nexus" - }, - { - "name": "tabula" - }, - { - "name": "tekton" - }, - { - "name": "tesselle" - } - ] -}