Docker PlexTV Builder #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker PlexTV Builder | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
paths: | |
- 'Dockerfile' | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
super-linter: | |
uses: ocpdude/plextv/.github/workflows/super-linter.yaml@main | |
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: Get the date | |
id: date | |
run: echo "::set-output name=date::$(date +'%m%d')" | |
- 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@v2 | |
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 |