mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-11-28 15:30:23 +08:00
102 lines
3.1 KiB
YAML
102 lines
3.1 KiB
YAML
name: Release Docker Build
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build-web:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Docker meta web
|
|
id: meta_web
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
name=ghcr.io/${{ github.repository }}-web
|
|
name=githubyumao/mcsmanager-web,enable=${{ github.repository == 'MCSManager/MCSManager' }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to ghcr.io
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Login to DockerHub
|
|
if: ${{ github.repository == 'MCSManager/MCSManager' }}
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
- name: Build and Push Web
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
file: dockerfile/web.dockerfile
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: ${{ steps.meta_web.outputs.tags }}
|
|
labels: ${{ steps.meta_web.outputs.labels }}
|
|
build-args: |
|
|
BUILDPLATFORM=linux/amd64
|
|
|
|
build-daemon:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
java_version: [8, 11, 17, 21]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Docker meta daemon
|
|
id: meta_daemon
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
name=ghcr.io/${{ github.repository }}-daemon,enable=${{ matrix.java_version == 21 }}
|
|
name=githubyumao/mcsmanager-daemon,enable=${{ github.repository == 'MCSManager/MCSManager' && matrix.java_version == 21 }}
|
|
name=ghcr.io/${{ github.repository }}-daemon-jdk${{ matrix.java_version }}
|
|
name=githubyumao/mcsmanager-daemon-jdk${{ matrix.java_version }},enable=${{ github.repository == 'MCSManager/MCSManager' }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to ghcr.io
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Login to DockerHub
|
|
if: ${{ github.repository == 'MCSManager/MCSManager' }}
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
- name: Build and Push Daemon
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
file: dockerfile/daemon.dockerfile
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: ${{ steps.meta_daemon.outputs.tags }}
|
|
labels: ${{ steps.meta_daemon.outputs.labels }}
|
|
build-args: |
|
|
BUILDPLATFORM=linux/amd64
|
|
EMBEDDED_JAVA_VERSION=${{ matrix.java_version }}
|