File tree Expand file tree Collapse file tree 3 files changed +52
-36
lines changed Expand file tree Collapse file tree 3 files changed +52
-36
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ inputs:
20
20
runs :
21
21
using : composite
22
22
steps :
23
-
24
23
- name : Find PR Preview Comment
25
24
if : github.event_name == 'pull_request'
26
25
uses : peter-evans/find-comment@v1
67
66
🚀 Preview this PR: ${{ steps.deploy-cloudflare.outputs.url }}
68
67
📍 Commit SHA: ${{ github.sha }}
69
68
70
-
71
69
- name : Update PR Preview Comment
72
70
if : github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id != 0
73
71
uses :
peter-evans/[email protected]
78
76
### ${{ inputs.project-name }}
79
77
🚀 Preview this PR: ${{ steps.deploy-cloudflare.outputs.url }}
80
78
📍 Commit SHA: ${{ github.sha }}
81
-
Original file line number Diff line number Diff line change
1
+ name : " Generate Datasheets"
2
+ description : " Generate product datasheets from markdown files"
3
+ inputs :
4
+ datasheets-path :
5
+ description : " The datasheets path"
6
+ required : true
7
+ default : static/resources/datasheets
8
+ artifact-name :
9
+ description : " The name of the output artifact"
10
+ required : true
11
+
12
+ runs :
13
+ using : composite
14
+ steps :
15
+ - uses : actions/cache@v4
16
+ id : cache
17
+ with :
18
+ path : ${{ inputs.datasheets-path }}
19
+ key : ${{ runner.os }}-datasheets-${{ hashFiles('**/*datasheet.md') }}
20
+
21
+ - uses : actions/checkout@v4
22
+ if : steps.cache.outputs.cache-hit != 'true'
23
+ with :
24
+ fetch-depth : 1
25
+
26
+ - uses : actions/setup-node@v4
27
+ if : steps.cache.outputs.cache-hit != 'true'
28
+ with :
29
+ node-version : 18
30
+ cache : " npm"
31
+ cache-dependency-path : " package-lock.json"
32
+
33
+ - name : Render Datasheets
34
+ if : steps.cache.outputs.cache-hit != 'true'
35
+ run : |
36
+ cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering
37
+ ./render-datasheets.sh
38
+ cd $GITHUB_WORKSPACE
39
+ mkdir -p ${{ inputs.datasheets-path }}
40
+ find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./${{ inputs.datasheets-path }}/ \;
41
+ shell : bash
42
+
43
+ - name : Export artifact
44
+ uses : actions/upload-artifact@v4
45
+ with :
46
+ name : ${{ inputs.artifact-name }}
47
+ path : ${{ inputs.datasheets-path }}
48
+ retention-days : 1 # Only needed to pass it to the next job
Original file line number Diff line number Diff line change @@ -22,39 +22,10 @@ jobs:
22
22
name : Render Datasheets
23
23
runs-on : ubuntu-latest
24
24
steps :
25
- - uses : actions/cache@v4
26
- id : cache
25
+ - uses : ./.github/actions/generated-datasheets
27
26
with :
28
- path : static/resources/datasheets
29
- key : ${{ runner.os }}-datasheets-${{ hashFiles('**/*datasheet.md') }}
30
-
31
- - uses : actions/checkout@v4
32
- if : steps.cache.outputs.cache-hit != 'true'
33
- with :
34
- fetch-depth : 1
35
-
36
- - uses : actions/setup-node@v4
37
- if : steps.cache.outputs.cache-hit != 'true'
38
- with :
39
- node-version : 18
40
- cache : " npm"
41
- cache-dependency-path : " package-lock.json"
42
-
43
- - name : Render Datasheets
44
- if : steps.cache.outputs.cache-hit != 'true'
45
- run : |
46
- cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering
47
- ./render-datasheets.sh
48
- cd $GITHUB_WORKSPACE
49
- mkdir -p static/resources/datasheets
50
- find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
51
-
52
- - name : Export artifact
53
- uses : actions/upload-artifact@v4
54
- with :
55
- name : datasheets
56
- path : static/resources/datasheets
57
- retention-days : 1 # Only needed to pass it to the next job
27
+ artifact-name : datasheets
28
+ datasheets-path : static/resources/datasheets
58
29
59
30
build :
60
31
name : Build and Deploy
79
50
cache : " npm"
80
51
cache-dependency-path : " package-lock.json"
81
52
82
- - uses : actions/download-artifact@v4
53
+ - uses : actions/download-artifact@v4 # Retrieve the datasheets generated in the previous job
83
54
with :
84
55
name : datasheets
85
56
You can’t perform that action at this time.
0 commit comments