diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 541417d..786d111 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -68,3 +68,26 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.onviffmqtt.outputs.tags }} labels: ${{ steps.onviffmqtt.outputs.labels }} + + id: onviffmqtt + uses: docker/metadata-action@v3 + with: + images: ghcr.io/ampretia/onviffmqtt + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}-alpine + type=semver,pattern={{major}}.{{minor}}-alpine + type=semver,pattern={{major}}-alpine + type=sha + + - name: build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + build-args: VARIANT=alpine + tags: ${{ steps.onviffmqtt.outputs.tags }} + labels: ${{ steps.onviffmqtt.outputs.labels }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index bb21c60..76c37be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -FROM node:20 AS builder + +ARG VARIANT="slim" + +FROM node:20-${VARIANT} AS builder WORKDIR /usr/src/app @@ -10,7 +13,7 @@ COPY --chown=node:node . /usr/src/app RUN npm ci && npm run build && npm shrinkwrap -FROM node:20 AS production +FROM node:20-${VARIANT} AS production WORKDIR /usr/src/app