From 11a4a92d97503206d09f5b1ebda7e521373a33d6 Mon Sep 17 00:00:00 2001 From: Jason Dove Date: Sun, 7 Mar 2021 09:59:13 -0600 Subject: [PATCH] push docker images on release --- .github/workflows/ci.yml | 59 +++++++++++++++------------ .github/workflows/release.yml | 77 +++++++++++++++++++++++++++++++++++ README.md | 1 + 3 files changed, 111 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18c5ac9fd..2ebedfcd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,16 +41,19 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + - name: Extract Git Tag shell: bash run: | - tag=$(git describe --tags --abbrev=0) - tag2="${tag:1}" - short=$(git rev-parse --short HEAD) - final="${tag2/prealpha/$short}" - echo "GIT_TAG=${final}" >> $GITHUB_ENV + tag=$(git describe --tags --abbrev=0) + tag2="${tag:1}" + short=$(git rev-parse --short HEAD) + final="${tag2/prealpha/$short}" + echo "GIT_TAG=${final}" >> $GITHUB_ENV + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + - name: Cache Docker layers uses: actions/cache@v2.1.4 with: @@ -58,11 +61,13 @@ jobs: key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildx- + - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - name: Build and push base uses: docker/build-push-action@v2 with: @@ -73,32 +78,34 @@ jobs: INFO_VERSION=${{ env.GIT_TAG }}-docker tags: | jasongdove/ersatztv:develop - jasongdove/ersatztv:develop-${{ github.sha }} + jasongdove/ersatztv:${{ github.sha }}-develop cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache,mode=max + - name: Build and push nvidia uses: docker/build-push-action@v2 with: - context: . - file: ./docker/nvidia/Dockerfile - push: true - build-args: | - INFO_VERSION=${{ env.GIT_TAG }}-docker-nvidia - tags: | - jasongdove/ersatztv:develop-nvidia - jasongdove/ersatztv:develop-nvidia-${{ github.sha }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache,mode=max + context: . + file: ./docker/nvidia/Dockerfile + push: true + build-args: | + INFO_VERSION=${{ env.GIT_TAG }}-docker-nvidia + tags: | + jasongdove/ersatztv:develop-nvidia + jasongdove/ersatztv:{{ github.sha }}-develop-nvidia + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache,mode=max + - name: Build and push vaapi uses: docker/build-push-action@v2 with: - context: . - file: ./docker/vaapi/Dockerfile - push: true - build-args: | - INFO_VERSION=${{ env.GIT_TAG }}-docker-vaapi - tags: | - jasongdove/ersatztv:develop-vaapi - jasongdove/ersatztv:develop-vaapi-${{ github.sha }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache,mode=max + context: . + file: ./docker/vaapi/Dockerfile + push: true + build-args: | + INFO_VERSION=${{ env.GIT_TAG }}-docker-vaapi + tags: | + jasongdove/ersatztv:develop-vaapi + jasongdove/ersatztv:${{ github.sha }}-develop-vaapi + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache,mode=max diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 358ab1a22..128f57594 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,3 +67,80 @@ jobs: ErsatzTV*.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + build_and_push: + name: Build & Publish to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Extract Git Tag + shell: bash + run: | + tag=$(git describe --tags --abbrev=0) + echo "GIT_TAG=${tag:1}" >> $GITHUB_ENV + echo "DOCKER_TAG=${tag/-prealpha/}" >> $GITHUB_ENV + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2.1.4 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build and push base + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile + push: true + build-args: | + INFO_VERSION=${{ env.GIT_TAG }}-docker + tags: | + jasongdove/ersatztv:latest + jasongdove/ersatztv:${{ env.DOCKER_TAG }} + jasongdove/ersatztv:${{ github.sha }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache,mode=max + + - name: Build and push nvidia + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/nvidia/Dockerfile + push: true + build-args: | + INFO_VERSION=${{ env.GIT_TAG }}-docker-nvidia + tags: | + jasongdove/ersatztv:latest-nvidia + jasongdove/ersatztv:${{ env.DOCKER_TAG }}-nvidia + jasongdove/ersatztv:${{ github.sha }}-nvidia + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache,mode=max + + - name: Build and push vaapi + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/vaapi/Dockerfile + push: true + build-args: | + INFO_VERSION=${{ env.GIT_TAG }}-docker-vaapi + tags: | + jasongdove/ersatztv:latest-vaapi + jasongdove/ersatztv:${{ env.DOCKER_TAG }}-vaapi + jasongdove/ersatztv:${{ github.sha }}-vaapi + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache,mode=max diff --git a/README.md b/README.md index 1532e8573..6ab92bc73 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Want to join the community or have a question? Join us on [Discord](https://disc - Channel-specific streaming mode (MPEG-TS or HLS) and transcoding settings - Collection-based scheduling, with collections containing television shows, seasons, episodes and movies - Powerful scheduling options such as chronological collection playback throughout the day or over multiple days +- Hardware-accelerated transcoding options (QSV, NVENC, VAAPI) ## In Development