diff --git a/.github/workflows/build_base.yaml b/.github/workflows/build_base.yaml new file mode 100644 index 00000000..1a03d9cb --- /dev/null +++ b/.github/workflows/build_base.yaml @@ -0,0 +1,86 @@ +name: "Build main base" + +on: + workflow_dispatch: + workflow_call: + push: + branches-ignore: + - "**" + +jobs: + docker: + runs-on: [self-hosted] + strategy: + matrix: + include: + - core: "16.14.0" + os: alpine + os_version: "3.19" + golang: golang:1.21-alpine3.19 + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 + branch: main + latest: yes + - core: "16.14.0" + os: ubuntu + os_version: "20.04" + golang: golang:1.21-alpine3.19 + platforms: linux/amd64 + branch: main + latest: yes + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + datarhei/base + tags: | + type=raw,value=core${{ matrix.core }}-${{ matrix.os }}${{ matrix.os_version }} + type=raw,value=${{ matrix.os }}-core-${{ matrix.os_version }}-${{ matrix.core}},enable=${{ matrix.latest == 'yes' }} + type=raw,value=${{ matrix.os }}-core-latest,enable=${{ matrix.latest == 'yes' }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v4 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build Multi-Arch + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./Dockerfile + build-args: | + BUILD_IMAGE=${{ matrix.os }}:${{ matrix.os_version }} + GOLANG_IMAGE=${{ matrix.golang }} + platforms: ${{ matrix.platforms }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new diff --git a/.github/workflows/build_base_alpine.yaml b/.github/workflows/build_base_alpine.yaml deleted file mode 100644 index d169479a..00000000 --- a/.github/workflows/build_base_alpine.yaml +++ /dev/null @@ -1,62 +0,0 @@ -name: "Build base:alpine-core" - -on: - workflow_dispatch: - push: - branches-ignore: - - "**" - -jobs: - docker: - runs-on: [self-hosted] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: cardinalby/export-env-action@v1 - with: - envFile: ".github_build/Build.alpine.env" - export: "true" - expandWithJobEnv: "true" - expand: "true" - - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build Multi-Arch - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile - build-args: | - BUILD_IMAGE=${{ env.OS_NAME }}:${{ env.OS_VERSION }} - GOLANG_IMAGE=${{ env.GOLANG_IMAGE }} - platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 - push: true - tags: | - datarhei/base:${{ env.OS_NAME }}-core-${{ env.OS_VERSION }}-${{ env.CORE_VERSION }} - datarhei/base:${{ env.OS_NAME }}-core-latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new diff --git a/.github/workflows/build_base_alpine_vod.yaml b/.github/workflows/build_base_alpine_vod.yaml deleted file mode 100644 index fddc58a8..00000000 --- a/.github/workflows/build_base_alpine_vod.yaml +++ /dev/null @@ -1,83 +0,0 @@ -name: 'Build base:alpine-core:vod' - -on: - workflow_dispatch: - workflow_call: - push: - branches: - - vod - -jobs: - docker: - runs-on: [self-hosted] - strategy: - matrix: - branch: - - vod - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ matrix.branch }} - - - uses: actions-ecosystem/action-get-latest-tag@v1 - id: get-latest-tag - with: - semver_only: true - - - uses: cardinalby/export-env-action@v1 - with: - envFile: '.github_build/Build.alpine.env' - export: 'true' - expandWithJobEnv: 'true' - expand: 'true' - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: | - datarhei/base - tags: | - type=raw,value=${{ env.OS_NAME }}-core-vod,enable=${{ matrix.branch == 'vod' }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build Multi-Arch - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile - build-args: | - BUILD_IMAGE=${{ env.OS_NAME }}:${{ env.OS_VERSION }} - GOLANG_IMAGE=${{ env.GOLANG_IMAGE }} - platforms: linux/amd64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new diff --git a/.github/workflows/build_base_alpine_dev.yaml b/.github/workflows/build_base_dev.yaml similarity index 59% rename from .github/workflows/build_base_alpine_dev.yaml rename to .github/workflows/build_base_dev.yaml index bb38a6c8..12d88511 100644 --- a/.github/workflows/build_base_alpine_dev.yaml +++ b/.github/workflows/build_base_dev.yaml @@ -1,4 +1,4 @@ -name: "Build base:alpine-core:dev" +name: "Build dev base" on: workflow_dispatch: @@ -12,35 +12,32 @@ jobs: runs-on: [self-hosted] strategy: matrix: - branch: - - dev + include: + - os: alpine + os_version: "3.19" + golang: golang:1.22-alpine3.19 + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 + branch: dev + - os: ubuntu + os_version: "20.04" + golang: golang:1.22-alpine3.19 + platforms: linux/amd64 + branch: dev steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ matrix.branch }} - - uses: actions-ecosystem/action-get-latest-tag@v1 - id: get-latest-tag - with: - semver_only: true - - - uses: cardinalby/export-env-action@v1 - with: - envFile: ".github_build/Build.alpine.dev.env" - export: "true" - expandWithJobEnv: "true" - expand: "true" - - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | datarhei/base tags: | - type=raw,value=${{ env.OS_NAME }}-core-dev,enable=${{ matrix.branch == 'dev' }} + type=raw,value=core-${{ matrix.branch }}-${{ matrix.os }}${{ matrix.os_version }} - name: Set up QEMU uses: docker/setup-qemu-action@master @@ -52,7 +49,7 @@ jobs: uses: docker/setup-buildx-action@master - name: Cache Docker layers - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} @@ -61,29 +58,26 @@ jobs: - name: Login to DockerHub if: github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build Multi-Arch - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: builder: ${{ steps.buildx.outputs.name }} context: . file: ./Dockerfile build-args: | - BUILD_IMAGE=${{ env.OS_NAME }}:${{ env.OS_VERSION }} - GOLANG_IMAGE=${{ env.GOLANG_IMAGE }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 + BUILD_IMAGE=${{ matrix.os }}:${{ matrix.os_version }} + GOLANG_IMAGE=${{ matrix.golang }} + platforms: ${{ matrix.platforms }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new - dockerBundle: - uses: ./.github/workflows/build_bundle_dev.yaml - secrets: inherit - dockerBundleRpi: - uses: ./.github/workflows/build_bundle-rpi_dev.yaml + bundle: + uses: ./.github/workflows/build_bundle_matrix_dev.yaml secrets: inherit diff --git a/.github/workflows/build_base_ubuntu.yaml b/.github/workflows/build_base_ubuntu.yaml deleted file mode 100644 index 8974b18d..00000000 --- a/.github/workflows/build_base_ubuntu.yaml +++ /dev/null @@ -1,62 +0,0 @@ -name: 'Build base:ubuntu-core' - -on: - workflow_dispatch: - push: - branches-ignore: - - '**' - -jobs: - docker: - runs-on: [self-hosted] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: cardinalby/export-env-action@v1 - with: - envFile: '.github_build/Build.ubuntu.env' - export: 'true' - expandWithJobEnv: 'true' - expand: 'true' - - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build Multi-Arch - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile - build-args: | - BUILD_IMAGE=${{ env.OS_NAME }}:${{ env.OS_VERSION }} - GOLANG_IMAGE=${{ env.GOLANG_IMAGE }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: | - datarhei/base:${{ env.OS_NAME }}-core-${{ env.OS_VERSION }}-${{ env.CORE_VERSION }} - datarhei/base:${{ env.OS_NAME }}-core-latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new diff --git a/.github/workflows/build_base_ubuntu_dev.yaml b/.github/workflows/build_base_ubuntu_dev.yaml deleted file mode 100644 index 33013fbe..00000000 --- a/.github/workflows/build_base_ubuntu_dev.yaml +++ /dev/null @@ -1,83 +0,0 @@ -name: 'Build datarhei/base:ubuntu-core-dev' - -on: - workflow_dispatch: - workflow_call: - push: - branches: - - dev - -jobs: - docker: - runs-on: [self-hosted] - strategy: - matrix: - branch: - - dev - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ matrix.branch }} - - - uses: actions-ecosystem/action-get-latest-tag@v1 - id: get-latest-tag - with: - semver_only: true - - - uses: cardinalby/export-env-action@v1 - with: - envFile: '.github_build/Build.ubuntu.env' - export: 'true' - expandWithJobEnv: 'true' - expand: 'true' - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: | - datarhei/base - tags: | - type=raw,value=${{ env.OS_NAME }}-core-dev,enable=${{ matrix.branch == 'dev' }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build Multi-Arch - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile - build-args: | - BUILD_IMAGE=${{ env.OS_NAME }}:${{ env.OS_VERSION }} - GOLANG_IMAGE=${{ env.GOLANG_IMAGE }} - platforms: linux/amd64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new diff --git a/.github/workflows/build_base_vod.yaml b/.github/workflows/build_base_vod.yaml new file mode 100644 index 00000000..66236eda --- /dev/null +++ b/.github/workflows/build_base_vod.yaml @@ -0,0 +1,82 @@ +name: "Build vod base" + +on: + workflow_dispatch: + workflow_call: + push: + branches: + - vod + +jobs: + docker: + runs-on: [self-hosted] + strategy: + matrix: + include: + - os: alpine + os_version: "3.19" + golang: golang:1.22-alpine3.19 + platforms: linux/amd64,linux/arm64 + branch: vod + key: alpine3.19 + - os: alpine + os_version: "3.16" + golang: golang:1.19-alpine3.16 + platforms: linux/amd64,linux/arm64 + branch: vod + key: alpine3.16 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + datarhei/base + tags: | + type=raw,value=core-${{ matrix.branch }}-${{ matrix.os }}${{ matrix.os_version }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v4 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build Multi-Arch + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./Dockerfile + build-args: | + BUILD_IMAGE=${{ matrix.os }}:${{ matrix.os_version }} + GOLANG_IMAGE=${{ matrix.golang }} + platforms: ${{ matrix.platforms }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new diff --git a/.github/workflows/build_bundle-cuda.yaml b/.github/workflows/build_bundle-cuda.yaml deleted file mode 100644 index cf3cb617..00000000 --- a/.github/workflows/build_bundle-cuda.yaml +++ /dev/null @@ -1,71 +0,0 @@ -name: 'Build core:cuda' - -on: - workflow_dispatch: - schedule: - - cron: '7 5 * * *' - push: - branches-ignore: - - '**' - -jobs: - docker: - runs-on: [self-hosted] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: cardinalby/export-env-action@v1 - with: - envFile: '.github_build/Build.ubuntu.env' - export: 'true' - expandWithJobEnv: 'true' - expand: 'true' - - - uses: cardinalby/export-env-action@v1 - with: - envFile: '.github_build/Build.bundle.cuda.env' - export: 'true' - expandWithJobEnv: 'true' - expand: 'true' - - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build Multi-Arch - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile.bundle - build-args: | - CORE_IMAGE=datarhei/base:${{ env.OS_NAME }}-core-${{ env.OS_VERSION }}-${{ env.CORE_VERSION }} - FFMPEG_IMAGE=datarhei/base:${{ env.OS_NAME }}-ffmpeg-cuda-${{ env.OS_VERSION }}-${{ env.FFMPEG_VERSION }}-${{ env.CUDA_VERSION }} - platforms: linux/amd64 - push: true - tags: | - datarhei/core:cuda-${{ env.CORE_VERSION }} - datarhei/core:cuda-latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new diff --git a/.github/workflows/build_bundle-rpi.yaml b/.github/workflows/build_bundle-rpi.yaml deleted file mode 100644 index 2f340d92..00000000 --- a/.github/workflows/build_bundle-rpi.yaml +++ /dev/null @@ -1,71 +0,0 @@ -name: "Build core:rpi" - -on: - workflow_dispatch: - schedule: - - cron: "7 5 * * *" - push: - branches-ignore: - - "**" - -jobs: - docker: - runs-on: [self-hosted] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: cardinalby/export-env-action@v1 - with: - envFile: ".github_build/Build.alpine.env" - export: "true" - expandWithJobEnv: "true" - expand: "true" - - - uses: cardinalby/export-env-action@v1 - with: - envFile: ".github_build/Build.bundle.rpi.env" - export: "true" - expandWithJobEnv: "true" - expand: "true" - - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build Multi-Arch - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile.bundle - build-args: | - CORE_IMAGE=datarhei/base:${{ env.OS_NAME }}-core-${{ env.OS_VERSION }}-${{ env.CORE_VERSION }} - FFMPEG_IMAGE=datarhei/base:${{ env.OS_NAME }}-ffmpeg-rpi-${{ env.OS_VERSION_FFMPEG }}-${{ env.FFMPEG_VERSION }} - platforms: linux/arm/v7,linux/arm64 - push: true - tags: | - datarhei/core:rpi-${{ env.CORE_VERSION }} - datarhei/core:rpi-latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new diff --git a/.github/workflows/build_bundle-rpi_dev.yaml b/.github/workflows/build_bundle-rpi_dev.yaml deleted file mode 100644 index c7c1066b..00000000 --- a/.github/workflows/build_bundle-rpi_dev.yaml +++ /dev/null @@ -1,69 +0,0 @@ -name: "Build datarhei/core:rpi-dev" - -on: - workflow_dispatch: - workflow_call: - push: - branches-ignore: - - "**" - -jobs: - docker: - runs-on: [self-hosted] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: cardinalby/export-env-action@v1 - with: - envFile: ".github_build/Build.alpine.dev.env" - export: "true" - expandWithJobEnv: "true" - expand: "true" - - - uses: cardinalby/export-env-action@v1 - with: - envFile: ".github_build/Build.bundle.rpi.dev.env" - export: "true" - expandWithJobEnv: "true" - expand: "true" - - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build Multi-Arch - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile.bundle - build-args: | - CORE_IMAGE=datarhei/base:${{ env.OS_NAME }}-core-dev - FFMPEG_IMAGE=datarhei/base:${{ env.OS_NAME }}-ffmpeg-rpi-${{ env.OS_VERSION }}-${{ env.FFMPEG_VERSION }} - platforms: linux/arm64,linux/arm/v7 - push: true - tags: | - datarhei/core:rpi-dev - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new diff --git a/.github/workflows/build_bundle-vaapi.yaml b/.github/workflows/build_bundle-vaapi.yaml deleted file mode 100644 index 52a5c857..00000000 --- a/.github/workflows/build_bundle-vaapi.yaml +++ /dev/null @@ -1,71 +0,0 @@ -name: 'Build core:vaapi' - -on: - workflow_dispatch: - schedule: - - cron: '7 5 * * *' - push: - branches-ignore: - - '**' - -jobs: - docker: - runs-on: [self-hosted] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: cardinalby/export-env-action@v1 - with: - envFile: '.github_build/Build.ubuntu.env' - export: 'true' - expandWithJobEnv: 'true' - expand: 'true' - - - uses: cardinalby/export-env-action@v1 - with: - envFile: '.github_build/Build.bundle.vaapi.env' - export: 'true' - expandWithJobEnv: 'true' - expand: 'true' - - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build Multi-Arch - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile.bundle - build-args: | - CORE_IMAGE=datarhei/base:${{ env.OS_NAME }}-core-${{ env.OS_VERSION }}-${{ env.CORE_VERSION }} - FFMPEG_IMAGE=datarhei/base:${{ env.OS_NAME }}-ffmpeg-vaapi-${{ env.OS_VERSION }}-${{ env.FFMPEG_VERSION }} - platforms: linux/amd64 - push: true - tags: | - datarhei/core:vaapi-${{ env.CORE_VERSION }} - datarhei/core:vaapi-latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new diff --git a/.github/workflows/build_bundle.yaml b/.github/workflows/build_bundle.yaml index 69292c3f..cb839aac 100644 --- a/.github/workflows/build_bundle.yaml +++ b/.github/workflows/build_bundle.yaml @@ -1,71 +1,97 @@ -name: 'Build core' +name: "Build main bundles" on: - workflow_dispatch: - schedule: - - cron: '7 5 * * *' - push: - branches-ignore: - - '**' + workflow_dispatch: + workflow_call: + schedule: + - cron: "7 5 * * *" + push: + branches-ignore: + - "**" jobs: - docker: - runs-on: [self-hosted] - steps: - - name: Checkout - uses: actions/checkout@v2 + docker: + runs-on: [self-hosted] + strategy: + matrix: + include: + - core: "16.14.0" + core_os: alpine3.19 + ffmpeg: "5.1.3" + ffmpeg_os: alpine3.16 + platforms: linux/amd64,linux/arm64,linux/arm/v7 + branch: main + prefix: + latest: yes + - core: "16.14.0" + core_os: alpine3.19 + ffmpeg: "5.1.3-rpi" + ffmpeg_os: alpine3.16 + platforms: linux/arm64,linux/arm/v7 + branch: main + prefix: rpi- + latest: yes + - core: "16.14.0" + core_os: ubuntu20.04 + ffmpeg: "5.1.3-vaapi" + ffmpeg_os: ubuntu20.04 + platforms: linux/amd64 + branch: main + prefix: vaapi- + latest: yes + - core: "16.14.0" + core_os: ubuntu20.04 + ffmpeg: "5.1.3-cuda" + ffmpeg_os: ubuntu20.04 + ffmpeg_tags: "-cuda11.7.1" + platforms: linux/amd64 + branch: main + prefix: cuda- + latest: yes - - uses: cardinalby/export-env-action@v1 - with: - envFile: '.github_build/Build.alpine.env' - export: 'true' - expandWithJobEnv: 'true' - expand: 'true' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} - - uses: cardinalby/export-env-action@v1 - with: - envFile: '.github_build/Build.bundle.env' - export: 'true' - expandWithJobEnv: 'true' - expand: 'true' + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + datarhei/core + tags: | + type=raw,value=${{ matrix.core }}-ffmpeg${{ matrix.ffmpeg }}${{ matrix.ffmpeg_tags }}-${{ matrix.core_os }} + type=raw,value=${{ matrix.prefix }}${{ matrix.core }},enable=${{ matrix.latest == 'yes' }} + type=raw,value=${{ matrix.prefix }}latest,enable=${{ matrix.latest == 'yes' }} - - name: Set up QEMU - uses: docker/setup-qemu-action@master - with: - platforms: all + - name: Set up QEMU + uses: docker/setup-qemu-action@master + with: + platforms: all - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build Multi-Arch - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile.bundle - build-args: | - CORE_IMAGE=datarhei/base:${{ env.OS_NAME }}-core-${{ env.OS_VERSION }}-${{ env.CORE_VERSION }} - FFMPEG_IMAGE=datarhei/base:${{ env.OS_NAME }}-ffmpeg-${{ env.OS_VERSION_FFMPEG }}-${{ env.FFMPEG_VERSION }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: | - datarhei/core:${{ env.CORE_VERSION }} - datarhei/core:latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new + - name: Build Multi-Arch + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./Dockerfile.bundle + build-args: | + CORE_IMAGE=datarhei/base:core${{ matrix.core }}-${{ matrix.core_os }} + FFMPEG_IMAGE=datarhei/base:ffmpeg${{ matrix.ffmpeg }}-${{ matrix.ffmpeg_os}}${{ matrix.ffmpeg_tags }} + platforms: ${{ matrix.platforms }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/build_bundle_dev.yaml b/.github/workflows/build_bundle_dev.yaml index 2509d0bb..f3dde3e3 100644 --- a/.github/workflows/build_bundle_dev.yaml +++ b/.github/workflows/build_bundle_dev.yaml @@ -1,4 +1,4 @@ -name: "Build datarhei/core:dev" +name: "Build dev bundles" on: workflow_dispatch: @@ -10,23 +10,54 @@ on: jobs: docker: runs-on: [self-hosted] + strategy: + matrix: + include: + - core_os: alpine3.19 + ffmpeg: "6.1.1" + ffmpeg_os: alpine3.19 + platforms: linux/amd64,linux/arm64,linux/arm/v7 + branch: dev + prefix: + latest: yes + - core_os: alpine3.19 + ffmpeg: "6.1.1-rpi" + ffmpeg_os: alpine3.19 + platforms: linux/arm64,linux/arm/v7 + branch: dev + prefix: rpi- + latest: yes + - core_os: ubuntu20.04 + ffmpeg: "6.1.1-vaapi" + ffmpeg_os: ubuntu20.04 + platforms: linux/amd64 + branch: dev + prefix: vaapi- + latest: yes + - core_os: ubuntu20.04 + ffmpeg: "6.1.1-cuda" + ffmpeg_os: ubuntu20.04 + ffmpeg_tags: "-cuda11.7.1" + platforms: linux/amd64 + branch: dev + prefix: cuda- + latest: yes + steps: - name: Checkout - uses: actions/checkout@v2 - - - uses: cardinalby/export-env-action@v1 + uses: actions/checkout@v4 with: - envFile: ".github_build/Build.alpine.dev.env" - export: "true" - expandWithJobEnv: "true" - expand: "true" + ref: ${{ matrix.branch }} - - uses: cardinalby/export-env-action@v1 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 with: - envFile: ".github_build/Build.bundle.dev.env" - export: "true" - expandWithJobEnv: "true" - expand: "true" + images: | + datarhei/core + tags: | + type=raw,value=${{ matrix.branch }}-ffmpeg${{ matrix.ffmpeg }}${{ matrix.ffmpeg_tags }}-${{ matrix.core_os }} + type=raw,value=${{ matrix.prefix }}${{ matrix.branch }},enable=${{ matrix.latest == 'yes' }} - name: Set up QEMU uses: docker/setup-qemu-action@master @@ -37,33 +68,23 @@ jobs: id: buildx uses: docker/setup-buildx-action@master - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - name: Login to DockerHub if: github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build Multi-Arch - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: builder: ${{ steps.buildx.outputs.name }} context: . file: ./Dockerfile.bundle build-args: | - CORE_IMAGE=datarhei/base:${{ env.OS_NAME }}-core-dev - FFMPEG_IMAGE=datarhei/base:${{ env.OS_NAME }}-ffmpeg-${{ env.OS_VERSION }}-${{ env.FFMPEG_VERSION }} - platforms: linux/amd64,linux/arm64,linux/arm/v7 + CORE_IMAGE=datarhei/base:core-${{ matrix.branch }}-${{ matrix.core_os }} + FFMPEG_IMAGE=datarhei/base:ffmpeg${{ matrix.ffmpeg }}-${{ matrix.ffmpeg_os}}${{ matrix.ffmpeg_tags }} + platforms: ${{ matrix.platforms }} push: true - tags: | - datarhei/core:dev - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github_build/Build.alpine.dev.env b/.github_build/Build.alpine.dev.env deleted file mode 100644 index ef956148..00000000 --- a/.github_build/Build.alpine.dev.env +++ /dev/null @@ -1,5 +0,0 @@ -# CORE ALPINE BASE IMAGE -OS_NAME=alpine -OS_VERSION=3.19 -GOLANG_IMAGE=golang:1.21-alpine3.19 -CORE_VERSION=16.14.0 diff --git a/.github_build/Build.alpine.env b/.github_build/Build.alpine.env deleted file mode 100644 index 66e888c9..00000000 --- a/.github_build/Build.alpine.env +++ /dev/null @@ -1,6 +0,0 @@ -# CORE ALPINE BASE IMAGE -OS_NAME=alpine -OS_VERSION=3.19 -OS_VERSION_FFMPEG=3.16 -GOLANG_IMAGE=golang:1.21-alpine3.19 -CORE_VERSION=16.14.0 diff --git a/.github_build/Build.bundle.cuda.env b/.github_build/Build.bundle.cuda.env deleted file mode 100644 index be91c889..00000000 --- a/.github_build/Build.bundle.cuda.env +++ /dev/null @@ -1,3 +0,0 @@ -# CORE NVIDIA CUDA BUNDLE -FFMPEG_VERSION=5.1.3 -CUDA_VERSION=11.7.1 diff --git a/.github_build/Build.bundle.dev.env b/.github_build/Build.bundle.dev.env deleted file mode 100644 index e4b9dc47..00000000 --- a/.github_build/Build.bundle.dev.env +++ /dev/null @@ -1,2 +0,0 @@ -# CORE BUNDLE -FFMPEG_VERSION=6.1.1 diff --git a/.github_build/Build.bundle.env b/.github_build/Build.bundle.env deleted file mode 100644 index 6758f80d..00000000 --- a/.github_build/Build.bundle.env +++ /dev/null @@ -1,2 +0,0 @@ -# CORE BUNDLE -FFMPEG_VERSION=5.1.3 diff --git a/.github_build/Build.bundle.rpi.dev.env b/.github_build/Build.bundle.rpi.dev.env deleted file mode 100644 index 141f5ae5..00000000 --- a/.github_build/Build.bundle.rpi.dev.env +++ /dev/null @@ -1,2 +0,0 @@ -# CORE RASPBERRY-PI BUNDLE -FFMPEG_VERSION=6.1.1 diff --git a/.github_build/Build.bundle.rpi.env b/.github_build/Build.bundle.rpi.env deleted file mode 100644 index 3dbe35a9..00000000 --- a/.github_build/Build.bundle.rpi.env +++ /dev/null @@ -1,2 +0,0 @@ -# CORE RASPBERRY-PI BUNDLE -FFMPEG_VERSION=5.1.3 diff --git a/.github_build/Build.bundle.vaapi.env b/.github_build/Build.bundle.vaapi.env deleted file mode 100644 index 6758f80d..00000000 --- a/.github_build/Build.bundle.vaapi.env +++ /dev/null @@ -1,2 +0,0 @@ -# CORE BUNDLE -FFMPEG_VERSION=5.1.3 diff --git a/.github_build/Build.ubuntu.env b/.github_build/Build.ubuntu.env deleted file mode 100644 index df5d5738..00000000 --- a/.github_build/Build.ubuntu.env +++ /dev/null @@ -1,5 +0,0 @@ -# CORE UBUNTU BASE IMAGE -OS_NAME=ubuntu -OS_VERSION=20.04 -GOLANG_IMAGE=golang:1.21-alpine3.19 -CORE_VERSION=16.14.0