Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Docker images

# The images are built for every push to master and for pull requests, to verify that they can be built.
# When a version tag (e.g. v1.2.3) is pushed, they are built for all supported platforms and published
# to Docker Hub with the version (1.2.3) and 'latest' as tags.
# Publishing requires the repository secrets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN.

on:
push:
branches:
- master
tags:
- 'v*'
pull_request:

jobs:
build:
name: ${{ matrix.image }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- image: openmu
dockerfile: src/Startup/Dockerfile
- image: openmu-admin
dockerfile: src/Dapr/AdminPanel.Host/Dockerfile
- image: openmu-chat
dockerfile: src/Dapr/ChatServer.Host/Dockerfile
- image: openmu-connect
dockerfile: src/Dapr/ConnectServer.Host/Dockerfile
- image: openmu-friend
dockerfile: src/Dapr/FriendServer.Host/Dockerfile
- image: openmu-game
dockerfile: src/Dapr/GameServer.Host/Dockerfile
- image: openmu-guild
dockerfile: src/Dapr/GuildServer.Host/Dockerfile
- image: openmu-login
dockerfile: src/Dapr/LoginServer.Host/Dockerfile

env:
PUBLISH: ${{ startsWith(github.ref, 'refs/tags/v') }}

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
if: env.PUBLISH == 'true'
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
if: env.PUBLISH == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Determine the image tags
id: meta
uses: docker/metadata-action@v5
with:
images: munique/${{ matrix.image }}
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=pr

- name: Build and publish
uses: docker/build-push-action@v6
with:
context: src
file: ${{ matrix.dockerfile }}
platforms: ${{ env.PUBLISH == 'true' && 'linux/amd64,linux/arm64,linux/arm/v7' || 'linux/amd64' }}
push: ${{ env.PUBLISH == 'true' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 2 additions & 0 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ jobs:
dotnet-version: 10.0.x
- name: Build with dotnet
run: dotnet publish src/Startup/MUnique.OpenMU.Startup.csproj --configuration Release -p:ci=true
- name: Test with dotnet
run: dotnet test src/MUnique.OpenMU.sln --configuration Release -p:ci=true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

| Platform |Build Status |
|----------------|----------------------|
| Windows | ![Windows Build Status](https://dev.azure.com/MUnique/OpenMU/_apis/build/status/MUnique.OpenMU?branchName=master) |
| Linux (Docker) | [![Docker Build Status](https://dev.azure.com/MUnique/OpenMU/_apis/build/status/MUnique.OpenMU%20Docker?branchName=master)](https://hub.docker.com/r/munique/openmu) |
| Linux | [![Build Status](https://github.com/MUnique/OpenMU/actions/workflows/dotnetcore.yml/badge.svg?branch=master)](https://github.com/MUnique/OpenMU/actions/workflows/dotnetcore.yml) |
| Linux (Docker) | [![Docker Build Status](https://github.com/MUnique/OpenMU/actions/workflows/docker.yml/badge.svg?branch=master)](https://hub.docker.com/r/munique/openmu) |

| NuGet Packages | |
|----------------|---|
Expand Down
36 changes: 0 additions & 36 deletions azure-pipelines.yml

This file was deleted.

2 changes: 1 addition & 1 deletion src/MUnique.OpenMU.sln
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
..\.gitignore = ..\.gitignore
..\azure-pipelines.yml = ..\azure-pipelines.yml
..\.github\workflows\docker.yml = ..\.github\workflows\docker.yml
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
..\.github\workflows\dotnetcore.yml = ..\.github\workflows\dotnetcore.yml
Expand Down
Loading