action.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. name: Deploy markdown.html
  2. description: Compress markdown.html and deploy to target directory
  3. author: 'PJ568'
  4. inputs:
  5. target-dir:
  6. description: Relative path under $GITHUB_WORKSPACE to deploy the minimized HTML file
  7. default: ""
  8. file-name:
  9. description: Name of the minimized HTML file
  10. default: "index.html"
  11. use-minified:
  12. description: Whether to use minified HTML file
  13. default: "true"
  14. use-all-in-one:
  15. description: Whether to use all-in-one HTML file
  16. default: "false"
  17. runs:
  18. using: "composite"
  19. steps:
  20. - name: Get version
  21. id: version-get
  22. run: |
  23. chmod +x ./scripts/get-version.bash
  24. VERSION=$(./scripts/get-version.bash)
  25. echo "version=${VERSION}" >> $GITHUB_OUTPUT
  26. if [ "$VERSION" != "0" ]; then
  27. echo "Version detected: $VERSION"
  28. else
  29. echo "No version detacted"
  30. fi
  31. shell: bash
  32. - name: Generate file name
  33. run: |
  34. USE_ALL_IN_ONE=""
  35. USE_MINIFIED=""
  36. if [ "${{ inputs.use-all-in-one }}" = "true" ]; then
  37. USE_ALL_IN_ONE=".allinone"
  38. fi
  39. if [ "${{ inputs.use-minified }}" = "true" ]; then
  40. USE_MINIFIED=".min"
  41. fi
  42. echo "file_name=index${USE_ALL_IN_ONE}${USE_MINIFIED}.html" >> $GITHUB_OUTPUT
  43. shell: bash
  44. - name: Deploy pre-generated markdown.html file
  45. uses: robinraju/release-downloader@v1
  46. with:
  47. repository: 'PJ-568/MAKRDOWN.HTML'
  48. tag: ${{ steps.version-get.outputs.version }}
  49. fileName: ${{ steps.file-name.outputs.file_name }}
  50. tarBall: false
  51. zipBall: false
  52. out-file-path: ${{ inputs.target-dir }}
  53. branding:
  54. icon: 'book-open'
  55. color: 'green'