Skip to content

Commit afb585e

Browse files
authored
Test out preview artifacts for PRs (#593)
* Test out preview artifacts for PRs * add dependcy on remotes from discovery * ghrocker preview command
1 parent d6f858c commit afb585e

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

.github/workflows/test_build.yaml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,41 @@ jobs:
1212
./docker/build.sh
1313
- name: 'Run Devel Build'
1414
run: |
15-
./docker/run.sh make test-build
15+
./docker/run.sh make test-build
16+
- name: Upload document artifacts
17+
uses: actions/upload-artifact@v4
18+
id: artifact-upload-step
19+
with:
20+
name: rosindex-test-render-${{ github.event.pull_request.number }}
21+
path: _site
22+
retention-days: 30 # default 90
23+
compression-level: 9 # maximum compression, default 6
24+
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
25+
26+
- name: Find Site Test Render link comment
27+
uses: peter-evans/find-comment@v3
28+
id: find-comment
29+
# Skip if PR from fork
30+
if: github.repository == github.event.pull_request.head.repo.full_name
31+
with:
32+
issue-number: ${{ github.event.pull_request.number }}
33+
comment-author: 'github-actions[bot]'
34+
body-includes: "Site Test Render:"
35+
36+
- name: Create or update Site Test Render link comment
37+
uses: peter-evans/create-or-update-comment@v4
38+
# Skip if PR from fork
39+
if: github.repository == github.event.pull_request.head.repo.full_name
40+
with:
41+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
42+
issue-number: ${{ github.event.pull_request.number }}
43+
body: |
44+
Site Test Render: ${{ steps.artifact-upload-step.outputs.artifact-url }}.
45+
46+
To view the resulting site:
47+
1. Click on the above link to download the artifacts archive
48+
2. Extract it
49+
3. View it using your favorite local rendering tool.
50+
a. As one example: Run `ghrocker --devel rosindex-test-render-${{ github.event.pull_request.number }}` Requires ghrocker installed https://github.com/tfoote/ghrocker
51+
b. Open http://localhost:4000 in your favorite browser
52+
edit-mode: replace

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $(PIP_FILE):
3030
@echo "Get pip descriptions file"
3131
python3 $(PIP_SCRIPT)
3232

33-
$(DISCOVERY_RESULTS):
33+
$(DISCOVERY_RESULTS): prepare-sources
3434
@echo "Rebuild discovery file that contains discovered repos"
3535
bundle exec $(DISCOVERY_SCRIPT) --config=$(config_file),$(index_file) --path=$(DISCOVERY_RESULTS) --errors=$(DISCOVERY_ERRORS)
3636

0 commit comments

Comments
 (0)