Skip to content

Commit

Permalink
Update description on DockerHub on release
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-asriyan committed Oct 25, 2023
1 parent 1143c0f commit 0a3d4c2
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 7 deletions.
45 changes: 38 additions & 7 deletions .github/workflows/cd-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- lottie-to-apng
- lottie-to-gif
- lottie-to-png
- lottie-to-webp
format:
- apng
- gif
- png
- webp
steps:
- name: Login to DockerHub
uses: docker/login-action@v2
Expand All @@ -81,10 +81,41 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Create manifest
run: docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:latest --amend ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:amd64 --amend ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:arm64
run: docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:latest --amend ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:amd64 --amend ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:arm64

- name: Push manifest
run: docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:latest
run: docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:latest

- name: Make format uppercase
id: format
uses: ASzc/change-string-case-action@v5
with:
string: ${{ matrix.format }}

- uses: actions/checkout@v4

- name: Find and replace FORMAT
uses: jacobtomlinson/gha-find-replace@v3
with:
find: FORMAT
replace: ${{ steps.format.outputs.uppercase }}
regex: false

- name: Find and replace format
uses: jacobtomlinson/gha-find-replace@v3
with:
find: format
replace: ${{ matrix.format }}
regex: false

- name: Update description at DockerHub
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}
short-description: Converts Lottie Animations (.json / .lottie) and Telegram stickers (*.tgs) to ${{ steps.format.outputs.uppercase }}}
readme-filepath: README.dockerhub.md

create-release:
name: Release executables
Expand Down
22 changes: 22 additions & 0 deletions README.dockerhub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Lottie Animations (.json) and Telegram Stickers (*.tgs) to FORMAT converter
Replace with directory with Lottie animations / Telegram stickers and run:
```bash
docker run --rm -v <path to directory>:/source edasriyan/lottie-to-format
```

You can provide parameters via env variables:
* `HEIGHT`: Output image height. Default: 512
* `WIDTH`: Output image width. Default: 512
* `FPS`: Output frame rate. Default: apng,png,webp - 60; gif - 50
* `QUALITY`: Output quality. Default: 90
* `THREADS`: Number of threads to use. Default: number of CPUs

Example:
```bash
docker run --rm -e HEIGHT=256 -e WIDTH=256 -e FPS=30 -v /home/ed/Downloads/lottie-animations:/source edasriyan/lottie-to-format
```

Results will be saved next to each source file in the same directory.

## Source
https://github.com/ed-asriyan/lottie-converter

0 comments on commit 0a3d4c2

Please sign in to comment.