Skip to content

Docker PlexTV Builder #8

Docker PlexTV Builder

Docker PlexTV Builder #8

Workflow file for this run

name: Docker PlexTV Builder
on:
pull_request:
branches:
- 'main'
paths:
- 'Dockerfile'
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
super-linter:
runs-on: ubuntu-latest
steps:
- name: Kubernetes-linter
uses: super-linter/super-linter/slim@v6.0.0
env:
KUBERNETES_KUBECONFORM_OPTIONS: --ignore-missing-schemas
FILTER_REGEX_INCLUDE: ./manifests/.*.yaml
VALIDATE_CHECKOV: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
security-checks:
permissions:
contents: read
security-events: write
actions: read
runs-on: ubuntu-latest
needs: [ super-linter ]
steps:
- uses: actions/checkout@v4
- name: Build the test image
# working-directory: ./openshift/builds/docker/
run: docker build . --tag localbuild/testimage:latest
- name: Grype scan the test image
uses: anchore/scan-action@v3
id: scan
with:
image: "localbuild/testimage:latest"
fail-build: false
severity-cutoff: critical
- name: Upload vulnerability report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
build-deployment:
needs: [ security-checks, super-linter ]
runs-on: ubuntu-latest
steps:
- name: Extract Plex TV version
id: plextv_version
run: echo "VERSION=$(grep "URL" Dockerfile | sed -n 's|.*plex-media-server-new/\([^/]*\)/.*|\1|p' | awk -F. '{print $1"."$2"."$3}')" >> $GITHUB_ENV
shell: bash
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: |
${{env.REGISTRY}}/ocpdude/plextv:${{ steps.date.outputs.date }}
${{env.REGISTRY}}/ocpdude/plextv:latest
shaker242/plextv:${{ steps.date.outputs.date }}
shaker242/plextv:latest