Skip to content

Merge pull request #288 from N5GEH/20-security-scan-of-the-image #47

Merge pull request #288 from N5GEH/20-security-scan-of-the-image

Merge pull request #288 from N5GEH/20-security-scan-of-the-image #47

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: ./
- dockerfile: ./backend/api/Dockerfile
image: api
context: ./
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 }}