Skip to content

Commit 6d759dc

Browse files
committed
WF debug surge error
1 parent 361faa1 commit 6d759dc

File tree

1 file changed

+65
-29
lines changed

1 file changed

+65
-29
lines changed

.github/workflows/publish-documentation.yml

Lines changed: 65 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,14 @@ on:
1717
- 'DESCRIPTION'
1818
- 'README.md' # TODO use the right file, the repo from the repo cannot be included (wrong format, too much info)
1919
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
2221
pr_preview:
2322
# TODO test Ubuntu 22
2423
runs-on: ubuntu-20.04
2524
permissions:
2625
pull-requests: write # surge-preview: PR comments
2726
steps:
2827
- 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
5528
- uses: bonitasoft/actions/packages/surge-preview-tools@v2
5629
id: surge-preview-tools
5730
with:
@@ -61,6 +34,13 @@ jobs:
6134
node --version
6235
npm --version
6336
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
6444
- name: Manage surge preview
6545
if: steps.surge-preview-tools.outputs.can-run-surge-command == 'true'
6646
uses: afc163/surge-preview@v1
@@ -70,7 +50,63 @@ jobs:
7050
dist: ./docs
7151
failOnError: true
7252
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
74110

75111
# generate:
76112
# if: github.event.action != 'closed' # on PR closed, only teardown the surge deployment

0 commit comments

Comments
 (0)