Files
PreMiD/.github/actions/build-and-push-docker/action.yaml
Bas van Zanten 7d93ee3a7d feat: add missing files (#1101)
* feat: add missing files

* chore: update readme

* chore: update branch

* chore: remove olds from matrix

* chore: remove dev containers
2025-12-11 11:07:38 +01:00

37 lines
1.2 KiB
YAML

name: Build and Push Docker Image
description: Builds a Docker image and pushes it to GitHub Container Registry
inputs:
app:
description: Name of the app
required: true
token:
description: GitHub token
required: true
outputs:
version:
description: Version of the app
value: ${{ steps.get_version.outputs.version }}
runs:
using: composite
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get package.json version
id: get_version
run: echo ::set-output name=version::$(node -p "require('./apps/${{ inputs.app }}/package.json').version")
shell: bash
- name: Convert repository owner to lowercase
id: repo
run: echo "::set-output name=lowercase::$(echo ${{ github.repository_owner }} | awk '{print tolower($0)}')"
shell: bash
- name: Build and Push Docker Image
uses: premid/premid/.github/actions/build-docker@monorepo
with:
dockerfile: ./apps/${{ inputs.app }}/Dockerfile
push: true
token: ${{ inputs.token }}
tags: ghcr.io/${{ steps.repo.outputs.lowercase }}/${{ inputs.app }}:${{ steps.get_version.outputs.version }},ghcr.io/${{ steps.repo.outputs.lowercase }}/${{ inputs.app }}:latest