Publish Scrypted Common #148
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: Publish Scrypted Common | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Push Docker image to Docker Hub | |
runs-on: self-hosted | |
env: | |
NODE_VERSION: '20' | |
strategy: | |
matrix: | |
BASE: ["jammy"] | |
FLAVOR: ["full", "lite"] | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up SSH | |
uses: MrSquaare/ssh-setup-action@v2 | |
with: | |
host: ${{ secrets.DOCKER_SSH_HOST_AMD64 }} | |
private-key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }} | |
- name: Set up SSH | |
uses: MrSquaare/ssh-setup-action@v2 | |
with: | |
host: ${{ secrets.DOCKER_SSH_HOST_ARM64 }} | |
private-key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: linux/amd64 | |
append: | | |
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_AMD64 }} | |
platforms: linux/amd64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: linux/arm64 | |
append: | | |
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_ARM64 }} | |
platforms: linux/arm64 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image (scrypted-common) | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
NODE_VERSION=${{ env.NODE_VERSION }} | |
BASE=${{ matrix.BASE }} | |
context: install/docker/ | |
file: install/docker/Dockerfile.${{ matrix.FLAVOR }} | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
koush/scrypted-common:${{ matrix.BASE }}-${{ matrix.FLAVOR }} | |
ghcr.io/koush/scrypted-common:${{ matrix.BASE }}-${{ matrix.FLAVOR }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-nvidia: | |
name: Push NVIDIA Docker image to Docker Hub | |
needs: build | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
BASE: ["jammy"] | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up SSH | |
uses: MrSquaare/ssh-setup-action@v2 | |
with: | |
host: ${{ secrets.DOCKER_SSH_HOST_AMD64 }} | |
private-key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }} | |
- name: Set up SSH | |
uses: MrSquaare/ssh-setup-action@v2 | |
with: | |
host: ${{ secrets.DOCKER_SSH_HOST_ARM64 }} | |
private-key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: linux/amd64 | |
append: | | |
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_AMD64 }} | |
platforms: linux/amd64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: linux/arm64 | |
append: | | |
- endpoint: ssh://${{ secrets.DOCKER_SSH_USER }}@${{ secrets.DOCKER_SSH_HOST_ARM64 }} | |
platforms: linux/arm64 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image (scrypted-common) | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
BASE=ghcr.io/koush/scrypted-common:${{ matrix.BASE }}-full | |
context: install/docker/ | |
file: install/docker/Dockerfile.nvidia | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
koush/scrypted-common:${{ matrix.BASE }}-nvidia | |
ghcr.io/koush/scrypted-common:${{ matrix.BASE }}-nvidia | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |