Skip to content

test no patch

test no patch #74

Workflow file for this run

name: Build OpenEMS Docker Image
on:
push:
branches:
- main
- 'workflow/**'
tags:
- "*.*.*"
env:
DOCKER_HUB_USER: dakai00
DOCKER_HUB_PREFIX: openems-
jobs:
docker:
runs-on: ubuntu-latest
strategy:
# Reset later
fail-fast: false
matrix:
image: [edge, backend, ui-edge, ui-backend]
include:
- image: edge
dockerfile: tools/docker/edge/openems/Dockerfile
- image: ui-edge
dockerfile: tools/docker/edge/ui/Dockerfile
- image: backend
dockerfile: tools/docker/backend/openems/Dockerfile
- image: ui-backend
dockerfile: tools/docker/backend/ui/Dockerfile
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get cleaned branch name
id: clean_name
run: |
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
echo "branch=${REF_NAME}-test" >> "$GITHUB_OUTPUT"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKER_HUB_USER }}/${{ env.DOCKER_HUB_PREFIX }}${{ matrix.image }}
ghcr.io/${{ github.REPOSITORY_OWNER }}/${{ matrix.image }}
labels: |
org.opencontainers.image.authors=da-Kai
org.opencontainers.image.title=OpenEMS ${{ matrix.image }}
org.opencontainers.image.vendor=da-Kai
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
latest
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
file: ${{ matrix.dockerfile }}
platforms: linux/amd64, linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}