Files
scrypted/.github/workflows/docker.yml
2022-06-27 11:47:16 -07:00

68 lines
2.4 KiB
YAML

name: Publish Scrypted
on:
workflow_dispatch:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
strategy:
matrix:
node: ["16-bullseye", "18-bullseye"]
variant: ["", ".lite"]
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
with:
path: server
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image (scrypted)
uses: docker/build-push-action@v2
with:
build-args: BASE=${{ matrix.node }}
context: .
file: docker/Dockerfile${{ matrix.variant }}
platforms: linux/amd64,linux/arm64,linux/armhf
push: true
tags: |
koush/scrypted:${{ matrix.node }}${{ matrix.variant }}
${{ format('koush/scrypted:v{0}{1}', steps.package-version.outputs.current-version, matrix.variant) || '' }}
${{ matrix.node == '16-bullseye' && matrix.variant == '' && 'koush/scrypted:latest' || '' }}
${{ matrix.node == '16-bullseye' && matrix.variant == '.lite' && 'koush/scrypted:lite' || '' }}
ghcr.io/koush/scrypted:${{ matrix.node }}${{ matrix.variant }}
${{ format('ghcr.io/koush/scrypted:v{0}{1}', steps.package-version.outputs.current-version, matrix.variant) || '' }}
${{ matrix.node == '16-bullseye' && matrix.variant == '' && 'ghcr.io/koush/scrypted:latest' || '' }}
${{ matrix.node == '16-bullseye' && matrix.variant == '.lite' && 'ghcr.io/koush/scrypted:lite' || '' }}
cache-from: type=gha
cache-to: type=gha,mode=max