action.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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: Generate file name
  21. run: |
  22. USE_ALL_IN_ONE=""
  23. USE_MINIFIED=""
  24. if [ "${{ inputs.use-all-in-one }}" = "true" ]; then
  25. USE_ALL_IN_ONE=".allinone"
  26. fi
  27. if [ "${{ inputs.use-minified }}" = "true" ]; then
  28. USE_MINIFIED=".min"
  29. fi
  30. echo "file_name=index${USE_ALL_IN_ONE}${USE_MINIFIED}.html" >> $GITHUB_OUTPUT
  31. shell: bash
  32. - name: Deploy pre-generated markdown.html file
  33. uses: robinraju/release-downloader@v1
  34. with:
  35. repository: 'PJ-568/MARKDOWN.HTML'
  36. latest: true
  37. fileName: ${{ steps.file-name.outputs.file_name }}
  38. tarBall: false
  39. zipBall: false
  40. out-file-path: ${{ inputs.target-dir }}
  41. - name: Rename file
  42. run: |
  43. mv $GITHUB_WORKSPACE/${{ steps.file-name.outputs.file_name }} $GITHUB_WORKSPACE/${{ inputs.file-name }}
  44. shell: bash
  45. branding:
  46. icon: 'book-open'
  47. color: 'green'