|
17 | 17 | - 'DESCRIPTION' |
18 | 18 | - 'README.md' # TODO use the right file, the repo from the repo cannot be included (wrong format, too much info) |
19 | 19 | jobs: |
20 | | - generate: |
21 | | - if: github.event.action != 'closed' # on PR closed, only teardown the surge deployment |
| 20 | + # for Pull Request |
| 21 | +# TODO manage close pr for surge teardown if: github.event.action != 'closed' |
| 22 | + pr_preview: |
| 23 | + # TODO test Ubuntu 22 |
22 | 24 | runs-on: ubuntu-20.04 |
| 25 | + permissions: |
| 26 | + pull-requests: write # surge-preview: PR comments |
23 | 27 | steps: |
24 | 28 | - uses: actions/checkout@v3 |
25 | 29 |
|
| 30 | +# TODO the following is duplicated with the R-CMD-check.yaml workflow |
26 | 31 | - uses: r-lib/actions/setup-r@v2 |
27 | | -# default r version: release |
28 | | -# with: |
29 | | -# use-public-rspm: true |
30 | | -# r-version: ${{ matrix.config.r }} |
| 32 | + # default r version: release |
| 33 | + # with: |
| 34 | + # use-public-rspm: true |
| 35 | + # r-version: ${{ matrix.config.r }} |
31 | 36 | - uses: r-lib/actions/setup-r-dependencies@v2 |
32 | 37 | with: |
33 | 38 | extra-packages: any::pkgdown, local::. |
34 | 39 | needs: website |
35 | 40 | - uses: r-lib/actions/setup-tinytex@v2 |
36 | 41 | - uses: r-lib/actions/setup-pandoc@v2 |
| 42 | +# end of duplication |
37 | 43 | - name: Install package |
38 | 44 | run: R CMD INSTALL . |
39 | 45 | - name: Build website |
40 | 46 | shell: Rscript {0} |
41 | 47 | run: | |
42 | 48 | pkgdown::build_site() |
| 49 | +# TODO only if we cannot publish to surge |
43 | 50 | - name: Upload |
44 | 51 | uses: actions/upload-artifact@v3 |
45 | 52 | with: |
46 | 53 | name: documentation-${{github.sha}} |
47 | 54 | path: docs |
48 | | - |
49 | | - publish_preview: |
50 | | - # on PR close, the 'generate' dependent job is skipped. So, without adding extra 'if' conditions, the job would be skipped as well |
51 | | - # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-not-requiring-successful-dependent-jobs |
52 | | - # TODO the following is NOT WORKING!! |
53 | | -# if: github.event_name == 'pull_request' && (needs.generate.result == 'success' || needs.generate.result == 'skipped') |
54 | | - if: github.event_name == 'pull_request' && always() |
55 | | - runs-on: ubuntu-20.04 |
56 | | - needs: generate |
57 | | - permissions: |
58 | | - pull-requests: write # surge-preview: PR comments |
59 | | - steps: |
60 | | - - name: Download documentation |
61 | | - if: github.event.action != 'closed' |
62 | | - uses: actions/download-artifact@v3 |
63 | | - with: |
64 | | - name: documentation-${{github.sha}} |
65 | 55 | - uses: bonitasoft/actions/packages/surge-preview-tools@v1 |
66 | 56 | id: surge-preview-tools |
67 | 57 | with: |
|
76 | 66 | failOnError: true |
77 | 67 | teardown: 'true' |
78 | 68 | build: echo 'already built!' |
| 69 | + |
| 70 | +# generate: |
| 71 | +# if: github.event.action != 'closed' # on PR closed, only teardown the surge deployment |
| 72 | +# |
| 73 | +# publish_preview: |
| 74 | +# # on PR close, the 'generate' dependent job is skipped. So, without adding extra 'if' conditions, the job would be skipped as well |
| 75 | +# # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-not-requiring-successful-dependent-jobs |
| 76 | +# # TODO the following is NOT WORKING!! |
| 77 | +## if: github.event_name == 'pull_request' && (needs.generate.result == 'success' || needs.generate.result == 'skipped') |
| 78 | +# if: github.event_name == 'pull_request' && always() |
| 79 | +# runs-on: ubuntu-20.04 |
| 80 | +# needs: generate |
| 81 | +# permissions: |
| 82 | +# pull-requests: write # surge-preview: PR comments |
| 83 | +# steps: |
| 84 | +# - name: Download documentation |
| 85 | +# if: github.event.action != 'closed' |
| 86 | +# uses: actions/download-artifact@v3 |
| 87 | +# with: |
| 88 | +# name: documentation-${{github.sha}} |
| 89 | +# - uses: bonitasoft/actions/packages/surge-preview-tools@v1 |
| 90 | +# id: surge-preview-tools |
| 91 | +# with: |
| 92 | +# surge-token: ${{ secrets.SURGE_TOKEN }} |
| 93 | +# - name: Manage surge preview |
| 94 | +# if: steps.surge-preview-tools.outputs.can-run-surge-command == 'true' |
| 95 | +# uses: afc163/surge-preview@v1 |
| 96 | +# with: |
| 97 | +# surge_token: ${{ secrets.GITHUB_TOKEN }} |
| 98 | +# github_token: ${{ secrets.SURGE_TOKEN }} |
| 99 | +# dist: ./docs |
| 100 | +# failOnError: true |
| 101 | +# teardown: 'true' |
| 102 | +# build: echo 'already built!' |
0 commit comments