From f35c123f9aa4e783e8281e59da2de5a760e64f25 Mon Sep 17 00:00:00 2001 From: Seji Date: Thu, 11 Aug 2022 16:20:21 +0200 Subject: [PATCH 1/2] Seperate build action for docker mod images --- .github/workflows/lscr.yml | 147 ++++++++++++++++ .github/workflows/main.yml | 351 ------------------------------------- 2 files changed, 147 insertions(+), 351 deletions(-) create mode 100644 .github/workflows/lscr.yml delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/lscr.yml b/.github/workflows/lscr.yml new file mode 100644 index 0000000..614e578 --- /dev/null +++ b/.github/workflows/lscr.yml @@ -0,0 +1,147 @@ +# This is a basic workflow to help you get started with Actions + +name: DockerMod Builds + +# Controls when the workflow will run +on: + workflow_dispatch: + push: + branches: + - 'master' + - 'dev' + - 'experimental' + tags: + - 'v*.*.*' + pull_request: + branches: + - 'master' + - 'dev' + +permissions: + contents: read + packages: write + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build-pms-docker-mod: + runs-on: ubuntu-latest + steps: + # Get the repositery's code + - name: Checkout + uses: actions/checkout@v3 + + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GHCR + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Docker meta for PMS-dockermod + id: meta_pms_dockermod + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + pabloromeo/clusterplex_dockermod + ghcr.io/pabloromeo/clusterplex_dockermod + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + - name: Build and push PMS-dockermod + uses: docker/build-push-action@v3 + with: + context: ./pms + file: ./pms/docker-mod/Dockerfile + platforms: linux/amd64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta_pms_dockermod.outputs.tags }} + labels: ${{ steps.meta_pms_dockermod.outputs.labels }} + - name: Docker Hub Description + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + repository: pabloromeo/clusterplex_dockermod + readme-filepath: ./README.md + short-description: "ClusterPlex Dockermod for the LinuxServer/Plex image" + + build-worker-docker-mod: + runs-on: ubuntu-latest + steps: + # Get the repositery's code + - name: Checkout + uses: actions/checkout@v3 + + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GHCR + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker meta for worker-dockermod + id: meta_worker_dockermod + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + pabloromeo/clusterplex_worker_dockermod + ghcr.io/pabloromeo/clusterplex_worker_dockermod + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + - name: Build and push worker-dockermod + uses: docker/build-push-action@v3 + with: + context: ./worker + file: ./worker/docker-mod/Dockerfile + platforms: linux/amd64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta_worker_dockermod.outputs.tags }} + labels: ${{ steps.meta_worker_dockermod.outputs.labels }} + - name: Docker Hub Description + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + repository: pabloromeo/clusterplex_worker_dockermod + readme-filepath: ./README.md + short-description: "ClusterPlex Worker Dockermod for the LinuxServer/Plex image" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index e5960e8..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,351 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Docker Builds - -# Controls when the workflow will run -on: - workflow_dispatch: - push: - branches: - - 'master' - - 'dev' - - 'experimental' - tags: - - 'v*.*.*' - pull_request: - branches: - - 'master' - - 'dev' - -permissions: - contents: read - packages: write - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - build-pms: - runs-on: ubuntu-latest - steps: - # Get the repositery's code - - name: Checkout - uses: actions/checkout@v3 - - # https://github.com/docker/setup-qemu-action - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - # https://github.com/docker/setup-buildx-action - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - -# - name: Available platforms -# run: echo ${{ steps.buildx.outputs.platforms }} - - - name: Login to GHCR - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Docker meta for PMS - id: meta_pms - uses: docker/metadata-action@v4 - with: - # list of Docker images to use as base name for tags - images: | - pabloromeo/clusterplex_pms - ghcr.io/pabloromeo/clusterplex_pms - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - - name: Build and push PMS - uses: docker/build-push-action@v3 - with: - context: ./pms - file: ./pms/extended-image/Dockerfile - platforms: linux/amd64,linux/arm/v7 # linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta_pms.outputs.tags }} - labels: ${{ steps.meta_pms.outputs.labels }} - - name: Docker Hub Description - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: pabloromeo/clusterplex_pms - readme-filepath: ./README.md - short-description: "PMS image for ClusterPlex" - build-pms-docker-mod: - runs-on: ubuntu-latest - steps: - # Get the repositery's code - - name: Checkout - uses: actions/checkout@v3 - - # https://github.com/docker/setup-buildx-action - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to GHCR - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Docker meta for PMS-dockermod - id: meta_pms_dockermod - uses: docker/metadata-action@v4 - with: - # list of Docker images to use as base name for tags - images: | - pabloromeo/clusterplex_dockermod - ghcr.io/pabloromeo/clusterplex_dockermod - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - - name: Build and push PMS-dockermod - uses: docker/build-push-action@v3 - with: - context: ./pms - file: ./pms/docker-mod/Dockerfile - platforms: linux/amd64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta_pms_dockermod.outputs.tags }} - labels: ${{ steps.meta_pms_dockermod.outputs.labels }} - - name: Docker Hub Description - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: pabloromeo/clusterplex_dockermod - readme-filepath: ./README.md - short-description: "ClusterPlex Dockermod for the LinuxServer/Plex image" - - build-worker: - runs-on: ubuntu-latest - steps: - # Get the repositery's code - - name: Checkout - uses: actions/checkout@v3 - - # https://github.com/docker/setup-qemu-action - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - # https://github.com/docker/setup-buildx-action - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - -# - name: Available platforms -# run: echo ${{ steps.buildx.outputs.platforms }} - - - name: Login to GHCR - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - - name: Docker meta for Worker - id: meta_worker - uses: docker/metadata-action@v4 - with: - # list of Docker images to use as base name for tags - images: | - pabloromeo/clusterplex_worker - ghcr.io/pabloromeo/clusterplex_worker - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - - name: Build and push Worker - uses: docker/build-push-action@v3 - with: - context: ./worker - file: ./worker/extended-image/Dockerfile - platforms: linux/amd64,linux/arm/v7 # linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta_worker.outputs.tags }} - labels: ${{ steps.meta_worker.outputs.labels }} - - name: Docker Hub Description - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: pabloromeo/clusterplex_worker - readme-filepath: ./README.md - short-description: "Worker image for ClusterPlex" - - build-worker-docker-mod: - runs-on: ubuntu-latest - steps: - # Get the repositery's code - - name: Checkout - uses: actions/checkout@v3 - - # https://github.com/docker/setup-buildx-action - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to GHCR - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - - name: Docker meta for worker-dockermod - id: meta_worker_dockermod - uses: docker/metadata-action@v4 - with: - # list of Docker images to use as base name for tags - images: | - pabloromeo/clusterplex_worker_dockermod - ghcr.io/pabloromeo/clusterplex_worker_dockermod - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - - name: Build and push worker-dockermod - uses: docker/build-push-action@v3 - with: - context: ./worker - file: ./worker/docker-mod/Dockerfile - platforms: linux/amd64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta_worker_dockermod.outputs.tags }} - labels: ${{ steps.meta_worker_dockermod.outputs.labels }} - - name: Docker Hub Description - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: pabloromeo/clusterplex_worker_dockermod - readme-filepath: ./README.md - short-description: "ClusterPlex Worker Dockermod for the LinuxServer/Plex image" - - build-orchestrator: - runs-on: ubuntu-latest - steps: - # Get the repositery's code - - name: Checkout - uses: actions/checkout@v3 - - # https://github.com/docker/setup-qemu-action - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - # https://github.com/docker/setup-buildx-action - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - -# - name: Available platforms -# run: echo ${{ steps.buildx.outputs.platforms }} - - - name: Login to GHCR - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - - name: Docker meta for Orchestrator - id: meta_orchestrator - uses: docker/metadata-action@v4 - with: - # list of Docker images to use as base name for tags - images: | - pabloromeo/clusterplex_orchestrator - ghcr.io/pabloromeo/clusterplex_orchestrator - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - - name: Build and push Orchestrator - uses: docker/build-push-action@v3 - with: - context: ./orchestrator - platforms: linux/amd64,linux/arm/v7 # linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta_orchestrator.outputs.tags }} - labels: ${{ steps.meta_orchestrator.outputs.labels }} - - name: Docker Hub Description - if: github.event_name != 'pull_request' - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: pabloromeo/clusterplex_orchestrator - readme-filepath: ./README.md - short-description: "ClusterPlex Orchestrator image" From 5e9942f53107c2fcd90e2f6b95dcb6d2b98099ff Mon Sep 17 00:00:00 2001 From: Seji Date: Thu, 11 Aug 2022 16:24:25 +0200 Subject: [PATCH 2/2] create seperate build action for clusterplex --- .github/workflows/main.yml | 230 +++++++++++++++++++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7753ef4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,230 @@ +# This is a basic workflow to help you get started with Actions + +name: Docker Builds + +# Controls when the workflow will run +on: + workflow_dispatch: + schedule: + - cron: '0 1 * * *' + push: + branches: + - 'master' + - 'dev' + - 'experimental' + tags: + - 'v*.*.*' + pull_request: + branches: + - 'master' + - 'dev' + +permissions: + contents: read + packages: write + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build-pms: + runs-on: ubuntu-latest + steps: + # Get the repositery's code + - name: Checkout + uses: actions/checkout@v3 + + # https://github.com/docker/setup-qemu-action + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + +# - name: Available platforms +# run: echo ${{ steps.buildx.outputs.platforms }} + + - name: Login to GHCR + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Docker meta for PMS + id: meta_pms + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + pabloromeo/clusterplex_pms + ghcr.io/pabloromeo/clusterplex_pms + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + - name: Build and push PMS + uses: docker/build-push-action@v3 + with: + context: ./pms + file: ./pms/extended-image/Dockerfile + platforms: linux/amd64,linux/arm/v7 # linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta_pms.outputs.tags }} + labels: ${{ steps.meta_pms.outputs.labels }} + - name: Docker Hub Description + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + repository: pabloromeo/clusterplex_pms + readme-filepath: ./README.md + short-description: "PMS image for ClusterPlex" + + build-worker: + runs-on: ubuntu-latest + steps: + # Get the repositery's code + - name: Checkout + uses: actions/checkout@v3 + + # https://github.com/docker/setup-qemu-action + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + +# - name: Available platforms +# run: echo ${{ steps.buildx.outputs.platforms }} + + - name: Login to GHCR + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - + name: Docker meta for Worker + id: meta_worker + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + pabloromeo/clusterplex_worker + ghcr.io/pabloromeo/clusterplex_worker + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + - name: Build and push Worker + uses: docker/build-push-action@v3 + with: + context: ./worker + file: ./worker/extended-image/Dockerfile + platforms: linux/amd64,linux/arm/v7 # linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta_worker.outputs.tags }} + labels: ${{ steps.meta_worker.outputs.labels }} + - name: Docker Hub Description + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + repository: pabloromeo/clusterplex_worker + readme-filepath: ./README.md + short-description: "Worker image for ClusterPlex" + + build-orchestrator: + runs-on: ubuntu-latest + steps: + # Get the repositery's code + - name: Checkout + uses: actions/checkout@v3 + + # https://github.com/docker/setup-qemu-action + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + +# - name: Available platforms +# run: echo ${{ steps.buildx.outputs.platforms }} + + - name: Login to GHCR + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - + name: Docker meta for Orchestrator + id: meta_orchestrator + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + pabloromeo/clusterplex_orchestrator + ghcr.io/pabloromeo/clusterplex_orchestrator + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + - name: Build and push Orchestrator + uses: docker/build-push-action@v3 + with: + context: ./orchestrator + platforms: linux/amd64,linux/arm/v7 # linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta_orchestrator.outputs.tags }} + labels: ${{ steps.meta_orchestrator.outputs.labels }} + - name: Docker Hub Description + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + repository: pabloromeo/clusterplex_orchestrator + readme-filepath: ./README.md + short-description: "ClusterPlex Orchestrator image"