|
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 | | - # for Pull Request |
21 | | -# TODO manage close pr for surge teardown if: github.event.action != 'closed' |
| 20 | + # TODO temp to debug surge deploy error |
22 | 21 | pr_preview: |
23 | 22 | # TODO test Ubuntu 22 |
24 | 23 | runs-on: ubuntu-20.04 |
25 | 24 | permissions: |
26 | 25 | pull-requests: write # surge-preview: PR comments |
27 | 26 | steps: |
28 | 27 | - uses: actions/checkout@v3 |
29 | | - |
30 | | -# TODO the following is duplicated with the R-CMD-check.yaml workflow |
31 | | - - uses: r-lib/actions/setup-r@v2 |
32 | | - # default r version: release |
33 | | - # with: |
34 | | - # use-public-rspm: true |
35 | | - # r-version: ${{ matrix.config.r }} |
36 | | - - uses: r-lib/actions/setup-r-dependencies@v2 |
37 | | - with: |
38 | | - extra-packages: any::pkgdown, local::. |
39 | | - needs: website |
40 | | - - uses: r-lib/actions/setup-tinytex@v2 |
41 | | - - uses: r-lib/actions/setup-pandoc@v2 |
42 | | -# end of duplication |
43 | | - - name: Install package |
44 | | - run: R CMD INSTALL . |
45 | | - - name: Build website |
46 | | - shell: Rscript {0} |
47 | | - run: | |
48 | | - pkgdown::build_site() |
49 | | -# TODO only if we cannot publish to surge |
50 | | - - name: Upload |
51 | | - uses: actions/upload-artifact@v3 |
52 | | - with: |
53 | | - name: documentation-${{github.sha}} |
54 | | - path: docs |
55 | 28 | - uses: bonitasoft/actions/packages/surge-preview-tools@v2 |
56 | 29 | id: surge-preview-tools |
57 | 30 | with: |
|
61 | 34 | node --version |
62 | 35 | npm --version |
63 | 36 | npx --version |
| 37 | + - name: Build fake demo |
| 38 | + if: ${{ github.event.action != 'closed' }} |
| 39 | + env: |
| 40 | + PR_NUMBER: ${{ github.event.pull_request.number }} |
| 41 | + run: | |
| 42 | + mkdir docs |
| 43 | + echo "This is a preview site for <b>PR #${PR_NUMBER}</b>" > docs/index.html |
64 | 44 | - name: Manage surge preview |
65 | 45 | if: steps.surge-preview-tools.outputs.can-run-surge-command == 'true' |
66 | 46 | uses: afc163/surge-preview@v1 |
|
70 | 50 | dist: ./docs |
71 | 51 | failOnError: true |
72 | 52 | teardown: 'true' |
73 | | - build: echo 'already built!' |
| 53 | + build: ls -lh docs |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + # for Pull Request |
| 58 | +# TODO manage close pr for surge teardown if: github.event.action != 'closed' |
| 59 | +# pr_preview: |
| 60 | +# # TODO test Ubuntu 22 |
| 61 | +# runs-on: ubuntu-20.04 |
| 62 | +# permissions: |
| 63 | +# pull-requests: write # surge-preview: PR comments |
| 64 | +# steps: |
| 65 | +# - uses: actions/checkout@v3 |
| 66 | +## TODO the following is duplicated with the R-CMD-check.yaml workflow |
| 67 | +# - uses: r-lib/actions/setup-r@v2 |
| 68 | +# # default r version: release |
| 69 | +# # with: |
| 70 | +# # use-public-rspm: true |
| 71 | +# # r-version: ${{ matrix.config.r }} |
| 72 | +# - uses: r-lib/actions/setup-r-dependencies@v2 |
| 73 | +# with: |
| 74 | +# extra-packages: any::pkgdown, local::. |
| 75 | +# needs: website |
| 76 | +# - uses: r-lib/actions/setup-tinytex@v2 |
| 77 | +# - uses: r-lib/actions/setup-pandoc@v2 |
| 78 | +## end of duplication |
| 79 | +# - name: Install package |
| 80 | +# run: R CMD INSTALL . |
| 81 | +# - name: Build website |
| 82 | +# shell: Rscript {0} |
| 83 | +# run: | |
| 84 | +# pkgdown::build_site() |
| 85 | +## TODO only if we cannot publish to surge |
| 86 | +# - name: Upload |
| 87 | +# uses: actions/upload-artifact@v3 |
| 88 | +# with: |
| 89 | +# name: documentation-${{github.sha}} |
| 90 | +# path: docs |
| 91 | +# - uses: bonitasoft/actions/packages/surge-preview-tools@v2 |
| 92 | +# id: surge-preview-tools |
| 93 | +# with: |
| 94 | +# surge-token: ${{ secrets.SURGE_TOKEN }} |
| 95 | +# - name: echo node environment |
| 96 | +# run: | |
| 97 | +# node --version |
| 98 | +# npm --version |
| 99 | +# npx --version |
| 100 | +# - name: Manage surge preview |
| 101 | +# if: steps.surge-preview-tools.outputs.can-run-surge-command == 'true' |
| 102 | +# uses: afc163/surge-preview@v1 |
| 103 | +# with: |
| 104 | +# surge_token: ${{ secrets.GITHUB_TOKEN }} |
| 105 | +# github_token: ${{ secrets.SURGE_TOKEN }} |
| 106 | +# dist: ./docs |
| 107 | +# failOnError: true |
| 108 | +# teardown: 'true' |
| 109 | +# build: ls -lh docs |
74 | 110 |
|
75 | 111 | # generate: |
76 | 112 | # if: github.event.action != 'closed' # on PR closed, only teardown the surge deployment |
|
0 commit comments