action.yml 928 B

1234567891011121314151617181920212223242526272829303132333435
  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: Directory to deploy the minimized HTML file
  7. default: "."
  8. required: true
  9. runs:
  10. using: "composite"
  11. steps:
  12. - name: Setup Rust
  13. uses: MatteoH2O1999/setup-rust@v1
  14. - name: Build project
  15. run: cargo build --release
  16. shell: bash
  17. working-directory: ${{ github.action_path }}
  18. - name: Generate minimized HTML
  19. run: cargo run --release -- ${{ github.action_path }}/index.html ${{ github.action_path }}/index.min.html
  20. shell: bash
  21. working-directory: ${{ github.action_path }}
  22. - name: Deploy minimized file
  23. run: |
  24. mkdir -p "${{ inputs.target-dir }}"
  25. cp -uv ${{ github.action_path }}/index.min.html "${{ inputs.target-dir }}/index.html"
  26. shell: bash
  27. branding:
  28. icon: 'book-open'
  29. color: 'green'