@@ -4,8 +4,8 @@ author: 'PJ568'
44
55inputs :
66 target-dir :
7- description : Directory to deploy the minimized HTML file
8- default : " . "
7+ description : Relative path under $GITHUB_WORKSPACE to deploy the minimized HTML file
8+ default : " "
99 file-name :
1010 description : Name of the minimized HTML file
1111 default : " index.html"
@@ -19,45 +19,42 @@ inputs:
1919runs :
2020 using : " composite"
2121 steps :
22- - name : Setup Rust
23- uses : MatteoH2O1999/setup-rust@v1
24- if : ${{ inputs.use-minified == 'true' || inputs.use-all-in-one == 'true' }}
25- working-directory : ${{ github.action_path }}
2622
27- - name : Cache Rust dependencies
28- if : ${{ inputs.use-minified == 'true' || inputs.use-all-in-one == 'true' }}
29- uses : Swatinem/rust-cache@v2
30- working-directory :
31- with :
32- workspaces : " ${{ github.action_path }} -> target"
33- cache-on-failure : " true"
34-
35- - name : Build project
36- if : ${{ inputs.use-minified == 'true' || inputs.use-all-in-one == 'true' }}
37- run : cargo build --release
38- shell : bash
39- working-directory : ${{ github.action_path }}
40-
41- - name : Generate minimized HTML
42- if : ${{ inputs.use-minified == 'true' || inputs.use-all-in-one == 'true' }}
43- run : cargo run --release -- index.html
23+ - name : Get version
24+ id : version-get
25+ run : |
26+ chmod +x ./scripts/get-version.bash
27+ VERSION=$(./scripts/get-version.bash)
28+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
29+ if [ "$VERSION" != "0" ]; then
30+ echo "Version detected: $VERSION"
31+ else
32+ echo "No version detacted"
33+ fi
4434 shell : bash
45- working-directory : ${{ github.action_path }}
4635
47- - name : Deploy file
36+ - name : Generate file name
4837 run : |
49- mkdir -p "${{ inputs.target-dir }}"
50- USE_MINIFIED=""
5138 USE_ALL_IN_ONE=""
52- if [ "${{ inputs.use-minified }}" = "true" ]; then
53- USE_MINIFIED=".min"
54- fi
39+ USE_MINIFIED=""
5540 if [ "${{ inputs.use-all-in-one }}" = "true" ]; then
5641 USE_ALL_IN_ONE=".allinone"
5742 fi
58- cp -uv index${USE_ALL_IN_ONE}${USE_MINIFIED}.html "${{ inputs.target-dir }}/${{ inputs.file-name }}"
43+ if [ "${{ inputs.use-minified }}" = "true" ]; then
44+ USE_MINIFIED=".min"
45+ fi
46+ echo "file_name=index${USE_ALL_IN_ONE}${USE_MINIFIED}.html" >> $GITHUB_OUTPUT
5947 shell : bash
60- working-directory : ${{ github.action_path }}
48+
49+ - name : Deploy pre-generated markdown.html file
50+ uses : robinraju/release-downloader@v1
51+ with :
52+ repository : ' PJ-568/MAKRDOWN.HTML'
53+ tag : ${{ steps.version-get.outputs.version }}
54+ fileName : ${{ steps.file-name.outputs.file_name }}
55+ tarBall : false
56+ zipBall : false
57+ out-file-path : ${{ inputs.target-dir }}
6158
6259branding :
6360 icon : ' book-open'
0 commit comments