push to dockerhub #78
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-hawccel-matrix-build | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' | |
env: | |
IMAGE_NAME: stash-s6 | |
permissions: | |
packages: write | |
contents: read | |
jobs: | |
builds-matrix: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- platform: "linux/amd64" | |
arch: "amd64" | |
tag: "amd64" | |
- platform: "linux/arm64" | |
arch: "arm64" | |
tag: "arm64" | |
- platform: "linux/arm/v6" | |
arch: "armel" | |
tag: "armv6" | |
- platform: "linux/arm/v7" | |
arch: "armhf" | |
tag: "armv7" | |
services: | |
registry: | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm,arm64 | |
- uses: docker/setup-buildx-action@v3 | |
with: | |
driver-opts: network=host | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: setup image names | |
run: | | |
echo "GHCR_IMAGE=ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}" >> "$GITHUB_ENV" | |
echo "DHIO_IMAGE=docker.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}" >> "$GITHUB_ENV" | |
- name: build hwaccel-base for local use | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
provenance: false | |
file: dockerfile/hwaccel-base.Dockerfile | |
platforms: ${{ matrix.platform }} | |
tags: | | |
localhost:5000/stash-s6:hwaccel-base | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: build hwaccel-deb | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
provenance: false | |
file: dockerfile/hwaccel-deb.Dockerfile | |
build-args: | | |
UPSTREAM_IMAGE=localhost:5000/${{ env.IMAGE_NAME }}:hwaccel-base | |
platforms: ${{ matrix.platform }} | |
tags: | | |
${{ env.GHCR_IMAGE }}:hwaccel-${{ matrix.tag }} | |
${{ secrets.DOCKERHUB_USERNAME }}:hwaccel-${{ matrix.tag }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: build hwaccel-jf | |
# no support for ARMEL | |
if: ${{ matrix.platform != 'linux/arm/v6' }} | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
provenance: false | |
file: dockerfile/hwaccel-jf.Dockerfile | |
build-args: | | |
ARCHITECTURE=${{ matrix.arch }} | |
UPSTREAM_IMAGE=localhost:5000/${{ env.IMAGE_NAME }}:hwaccel-base | |
platforms: ${{ matrix.platform }} | |
tags: | | |
${{ env.GHCR_IMAGE }}:hwaccel-jf-${{ matrix.tag }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
create-manifests: | |
needs: [builds-matrix] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: setup image names | |
run: | | |
echo "GHCR_IMAGE=ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}" >> "$GITHUB_ENV" | |
echo "DHIO_IMAGE=docker.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}" >> "$GITHUB_ENV" | |
- name: create manifest for GHCR/hwaccel | |
run: | | |
docker manifest create \ | |
${{ env.GHCR_IMAGE }}:hwaccel \ | |
--amend ${{ env.GHCR_IMAGE }}:hwaccel-amd64 \ | |
--amend ${{ env.GHCR_IMAGE }}:hwaccel-armv6 \ | |
--amend ${{ env.GHCR_IMAGE }}:hwaccel-armv7 \ | |
--amend ${{ env.GHCR_IMAGE }}:hwaccel-arm64 | |
docker manifest push ${{ env.GHCR_IMAGE }}:hwaccel | |
- name: create manifest for GHCR/hwaccel-jf | |
run: | | |
docker manifest create \ | |
${{ env.GHCR_IMAGE }}:hwaccel-jf \ | |
--amend ${{ env.GHCR_IMAGE }}:hwaccel-jf-amd64 \ | |
--amend ${{ env.GHCR_IMAGE }}:hwaccel-jf-armv7 \ | |
--amend ${{ env.GHCR_IMAGE }}:hwaccel-jf-arm64 | |
docker manifest push ${{ env.GHCR_IMAGE }}:hwaccel-jf | |
- name: create manifest for dhio/hwaccel | |
run: | | |
docker manifest create \ | |
${{ secrets.DOCKERHUB_USERNAME }}:hwaccel \ | |
--amend ${{ secrets.DOCKERHUB_USERNAME }}:hwaccel-amd64 \ | |
--amend ${{ secrets.DOCKERHUB_USERNAME }}:hwaccel-armv6 \ | |
--amend ${{ secrets.DOCKERHUB_USERNAME }}:hwaccel-armv7 \ | |
--amend ${{ secrets.DOCKERHUB_USERNAME }}:hwaccel-arm64 | |
docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}:hwaccel | |
- name: create manifest for dhio/hwaccel-jf | |
run: | | |
docker manifest create \ | |
${{ secrets.DOCKERHUB_USERNAME }}:hwaccel-jf \ | |
--amend ${{ secrets.DOCKERHUB_USERNAME }}:hwaccel-jf-amd64 \ | |
--amend ${{ secrets.DOCKERHUB_USERNAME }}:hwaccel-jf-armv7 \ | |
--amend ${{ secrets.DOCKERHUB_USERNAME }}:hwaccel-jf-arm64 | |
docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}:hwaccel-jf |