forked from MCSManager/MCSManager
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (85 loc) · 3.14 KB
/
docker.yml
File metadata and controls
102 lines (85 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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 }}