Skip to content

feat: use pydantic settings to load environment variables #34

feat: use pydantic settings to load environment variables

feat: use pydantic settings to load environment variables #34

Workflow file for this run

name: Create Docker Images for MQTT-Gateway
on:
push:
branches:
- main
release:
types:
- created
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./frontend/Dockerfile
image: frontend
context: ./frontend
- dockerfile: ./backend/gateway/Dockerfile
image: gateway
context: ./backend/gateway
- dockerfile: ./backend/api/Dockerfile
image: api
context: ./backend/api
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.image }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: ${{ matrix.context }}
file: ${{ matrix.Dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}