diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..04e7784 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..8ea71c0 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,93 @@ +name: docker + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + push: + branches: [ master ] + tags: [ 'v*.*.*' ] + +jobs: + build: + name: Docker + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Setup qemu for Docker buildx + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v2 + with: + image: tonistiigi/binfmt:latest + platforms: arm64 + + # Workaround: https://github.com/docker/build-push-action/issues/461 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v2 + with: + version: latest + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to Docker Hub + if: github.repository == 'cshum/imagorvideo' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: | + name=${{ format('ghcr.io/{0}', github.repository) }},enable=true + name=shumc/imagorvideo,enable=${{ github.repository == 'cshum/imagorvideo' }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image tag + if: startsWith(github.ref, 'refs/tags/v') + id: build-and-push-tag + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Build and push Docker image branch + if: startsWith(github.ref, 'refs/heads') + id: build-and-push-branch + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/README.md b/README.md index 0b33da6..2a363d1 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # imagorvideo -imagorvideo is a new initiative that brings video thumbnail capability through ffmpeg, built on the foundations of [imagor](https://github.com/cshum/imagor). imagor is a fast, Docker-ready image processing server written in Go with libvips. +imagorvideo is a new initiative that brings video thumbnail capability through ffmpeg, built on the foundations of [imagor](https://github.com/cshum/imagor) - a fast, Docker-ready image processing server written in Go with libvips. Imagorvideo uses ffmpeg C bindings that extracts image thumbnail from video by attempting to select the best frame, then forwards to libvips to perform all existing image operations supported by imagor. imagorvideo uses reader stream for mkv and webm video types. For other video types that requires seeking from a non seek-able source such as HTTP or S3, it simulates seek using memory buffer or temp file, by having the whole file to be fully loaded to perform seek. -**This project is a work in progress**. It also aims to be a reference project demonstrating imagor extensibility. Feel free to create a pull request or report an issue if you found bugs, suggestions or enhancements. +**This project is a work in progress**. It also aims to be a reference project demonstrating imagor extensibility. ### Quick Start @@ -18,7 +18,7 @@ Check out [imagor](https://github.com/cshum/imagor#image-endpoint) for all exist ### Configuration -Config options specific to imagorvideo. Check out [imagor](https://github.com/cshum/imagor#configuration) for all existing options supported. +Config options specific to imagorvideo. Please refer to [imagor](https://github.com/cshum/imagor#configuration) for all existing options supported. ``` -ffmpeg-fallback-image string