Add multi-arch container image builds (#132)

* Update versions for GH Actions

* Add build arg for Dockerfile

* Add automated tags for container image

* Add multi-arch image builds using QEMU and Buildx

* Add checks to ensure PRs don't publish images

* Auto-indent YAML

* Change web interface version name

* Revert back to `10.8.0` version name
This commit is contained in:
roib20 2023-02-07 10:34:43 +02:00 committed by GitHub
parent 0b62b0209e
commit 84919b65d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 96 additions and 56 deletions

View File

@ -29,7 +29,7 @@ jobs:
run: dotnet build --no-restore run: dotnet build --no-restore
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3.1.1 uses: actions/upload-artifact@v3.1.2
with: with:
name: intro-skipper-${{ github.sha }}.dll name: intro-skipper-${{ github.sha }}.dll
path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll

View File

@ -7,27 +7,23 @@ on:
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/jellyfin-intro-skipper
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read
packages: write packages: write
strategy: strategy:
matrix: matrix:
node-version: [18.x] node-version: [18.x]
jellyfin-version: [10.8.9]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Login to GHCR
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
@ -68,16 +64,59 @@ jobs:
tar czf dist.tar.gz dist tar czf dist.tar.gz dist
- name: Upload web interface - name: Upload web interface
uses: actions/upload-artifact@v3.1.1 uses: actions/upload-artifact@v3.1.2
with: with:
name: jellyfin-web-10.8.0+${{ steps.web-commit.outputs.commit }}.tar.gz name: jellyfin-web-10.8.0+${{ steps.web-commit.outputs.commit }}.tar.gz
path: web/dist.tar.gz path: web/dist.tar.gz
if-no-files-found: error if-no-files-found: error
- name: Publish container - name: Set up QEMU
uses: docker/build-push-action@v3.2.0 uses: docker/setup-qemu-action@v2
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into ghcr.io registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_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: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type-raw,value=${{ steps.web-commit.outputs.commit }}
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}},value=${{ matrix.jellyfin-version }}
# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Publish container image
id: build-and-push
uses: docker/build-push-action@v4.0.0
with: with:
file: docker/Dockerfile file: docker/Dockerfile
context: docker/ context: docker
push: true tags: ${{ steps.meta.outputs.tags }}
tags: ${{ env.REGISTRY}}/confusedpolarbear/jellyfin-intro-skipper:${{ steps.web-commit.outputs.commit }} labels: ${{ steps.meta.outputs.labels }}
build-args: |
JELLYFIN_TAG=${{ matrix.jellyfin-version }}
platforms: |
linux/amd64
linux/arm/v7
linux/arm64/v8
push: ${{ github.event_name != 'pull_request' }}
pull: true
no-cache: true
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false

View File

@ -32,7 +32,7 @@ jobs:
run: .github/workflows/package.sh ${{ steps.tag.outputs.tag }} run: .github/workflows/package.sh ${{ steps.tag.outputs.tag }}
- name: Upload plugin archive - name: Upload plugin archive
uses: actions/upload-artifact@v3.1.1 uses: actions/upload-artifact@v3.1.2
with: with:
name: intro-skipper-bundle-${{ steps.tag.outputs.tag }}.zip name: intro-skipper-bundle-${{ steps.tag.outputs.tag }}.zip
path: | path: |

View File

@ -1,3 +1,4 @@
FROM jellyfin/jellyfin:10.8.9 ARG JELLYFIN_TAG=10.8.9
FROM jellyfin/jellyfin:${JELLYFIN_TAG}
COPY dist/ /jellyfin/jellyfin-web/ COPY dist/ /jellyfin/jellyfin-web/