From a1fecf3bc8967202f95dd611eb9177a4297cb6da Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Thu, 23 May 2024 13:09:49 -0400 Subject: [PATCH 1/4] Only update the shiny submodule when making the docs https://github.com/posit-dev/shinylive/blob/144a5de66cc198044c918df9d786e92804d9ff25/Makefile#L94C4-L94C20 --- .github/workflows/build-docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml index c0fd21804..ddaa3e902 100644 --- a/.github/workflows/build-docs.yaml +++ b/.github/workflows/build-docs.yaml @@ -67,7 +67,7 @@ jobs: run: | cd shinylive-repo make submodules - make submodules-pull + make submodules-pull-shiny - name: Build shinylive if: github.ref == 'refs/heads/main' From 07a7682387c36c232ae36b65d57209a8ea64b39c Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Thu, 23 May 2024 13:19:38 -0400 Subject: [PATCH 2/4] Update step name and add make command for pulling latest for htmltools --- .github/workflows/build-docs.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml index ddaa3e902..4ac44e5f3 100644 --- a/.github/workflows/build-docs.yaml +++ b/.github/workflows/build-docs.yaml @@ -62,12 +62,13 @@ jobs: ref: main path: shinylive-repo - - name: Update shinylive's copy of shiny, htmltools, and other packages + - name: Update shinylive's copy of shiny and htmltools if: github.ref == 'refs/heads/main' run: | cd shinylive-repo make submodules make submodules-pull-shiny + make submodules-pull-htmltools - name: Build shinylive if: github.ref == 'refs/heads/main' From 1705aaa3609c9acbe024f63f7c4259380f5b8a5d Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Thu, 23 May 2024 13:23:47 -0400 Subject: [PATCH 3/4] Run many more steps if PR branch starts with `docs` --- .github/workflows/build-docs.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml index 4ac44e5f3..b9c3a184b 100644 --- a/.github/workflows/build-docs.yaml +++ b/.github/workflows/build-docs.yaml @@ -55,7 +55,7 @@ jobs: # Shinylive # ===================================================== - name: Check out shinylive - if: github.ref == 'refs/heads/main' + if: ${{ github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'docs') }} uses: actions/checkout@v4 with: repository: rstudio/shinylive @@ -63,7 +63,7 @@ jobs: path: shinylive-repo - name: Update shinylive's copy of shiny and htmltools - if: github.ref == 'refs/heads/main' + if: ${{ github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'docs') }} run: | cd shinylive-repo make submodules @@ -71,7 +71,7 @@ jobs: make submodules-pull-htmltools - name: Build shinylive - if: github.ref == 'refs/heads/main' + if: ${{ github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'docs') }} run: | cd shinylive-repo make all @@ -81,7 +81,7 @@ jobs: # ===================================================== - name: Move built API docs and shinylive to single directory - if: github.ref == 'refs/heads/main' + if: ${{ github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'docs') }} run: | mkdir deploy mv docs/_site deploy/docs From 460ee2439405ccbf48822a1bfbbac2d2534a1fbf Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Thu, 23 May 2024 13:45:49 -0400 Subject: [PATCH 4/4] Build site after building shinylive for faster shinylive feedback --- .github/workflows/build-docs.yaml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml index b9c3a184b..4a4ee9b9e 100644 --- a/.github/workflows/build-docs.yaml +++ b/.github/workflows/build-docs.yaml @@ -45,17 +45,11 @@ jobs: cd docs make quartodoc - - name: Build site - if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'merge_group' || startsWith(github.head_ref, 'docs') }} - run: | - cd docs - make site - # ===================================================== # Shinylive # ===================================================== - name: Check out shinylive - if: ${{ github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'docs') }} + if: github.ref == 'refs/heads/main' uses: actions/checkout@v4 with: repository: rstudio/shinylive @@ -63,7 +57,7 @@ jobs: path: shinylive-repo - name: Update shinylive's copy of shiny and htmltools - if: ${{ github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'docs') }} + if: github.ref == 'refs/heads/main' run: | cd shinylive-repo make submodules @@ -71,17 +65,29 @@ jobs: make submodules-pull-htmltools - name: Build shinylive - if: ${{ github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'docs') }} + if: github.ref == 'refs/heads/main' run: | cd shinylive-repo make all + # TODO-future; Install updated shinylive assets via updated py-shinylive pkg + + # ===================================================== + # Build site + # ===================================================== + + - name: Build site + if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'merge_group' || startsWith(github.head_ref, 'docs') }} + run: | + cd docs + make site + # ===================================================== # Deploy # ===================================================== - name: Move built API docs and shinylive to single directory - if: ${{ github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'docs') }} + if: github.ref == 'refs/heads/main' run: | mkdir deploy mv docs/_site deploy/docs