-
Notifications
You must be signed in to change notification settings - Fork 2
122 lines (117 loc) · 5.21 KB
/
Copy pathdocker-builds.yml
File metadata and controls
122 lines (117 loc) · 5.21 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Reusable workflow: all Docker image builds (base, manifests, steamcmd).
# Used by master build.yml and PR pr.yml to avoid duplication.
name: Docker builds (reusable)
on:
workflow_call:
inputs:
version_tag:
required: true
type: string
description: Version tag for images (e.g. v0.1.170 or 0.1.2-feature-branch)
version:
required: true
type: string
description: Version for manifest tags without v prefix (e.g. 0.1.170)
is_pr:
required: false
type: boolean
default: false
description: If true, do not push latest/stable tags (for PR builds)
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
DRUID_ARTIFACTS_REGISTRY_USERNAME:
required: true
DRUID_ARTIFACTS_REGISTRY_TOKEN:
required: true
jobs:
docker-base-amd64:
uses: ./.github/workflows/docker-build-reusable.yml
with:
dockerfile: Dockerfile
runs_on: ubuntu-latest
tags: |
highcard/druid:${{ inputs.version_tag }}-amd64
artifacts.druid.gg/druid-team/druid:${{ inputs.version_tag }}-amd64
build_args: |
VERSION=${{ inputs.version_tag }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DRUID_ARTIFACTS_REGISTRY_USERNAME: ${{ secrets.DRUID_ARTIFACTS_REGISTRY_USERNAME }}
DRUID_ARTIFACTS_REGISTRY_TOKEN: ${{ secrets.DRUID_ARTIFACTS_REGISTRY_TOKEN }}
docker-base-arm64:
uses: ./.github/workflows/docker-build-reusable.yml
with:
dockerfile: Dockerfile
runs_on: ubuntu-24.04-arm
tags: |
highcard/druid:${{ inputs.version_tag }}-arm64
artifacts.druid.gg/druid-team/druid:${{ inputs.version_tag }}-arm64
build_args: |
VERSION=${{ inputs.version_tag }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DRUID_ARTIFACTS_REGISTRY_USERNAME: ${{ secrets.DRUID_ARTIFACTS_REGISTRY_USERNAME }}
DRUID_ARTIFACTS_REGISTRY_TOKEN: ${{ secrets.DRUID_ARTIFACTS_REGISTRY_TOKEN }}
docker-base-manifest:
name: Create multi-arch base manifests
needs: [docker-base-amd64, docker-base-arm64]
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create and push base manifests
uses: Noelware/docker-manifest-action@v1
with:
inputs: highcard/druid:${{ inputs.version_tag }}-amd64,highcard/druid:${{ inputs.version_tag }}-arm64
tags: >-
highcard/druid:${{ inputs.version }},
highcard/druid:${{ inputs.version_tag }}${{ inputs.is_pr != true && ',highcard/druid:latest,highcard/druid:stable' || '' }}
push: true
docker-base-manifest-artifacts:
name: Create multi-arch base manifests (artifacts registry)
needs: [docker-base-amd64, docker-base-arm64]
runs-on: ubuntu-latest
steps:
- name: Login to Artifacts Registry
uses: docker/login-action@v3
with:
registry: artifacts.druid.gg
username: ${{ secrets.DRUID_ARTIFACTS_REGISTRY_USERNAME }}
password: ${{ secrets.DRUID_ARTIFACTS_REGISTRY_TOKEN }}
- name: Create and push base manifests (artifacts)
uses: Noelware/docker-manifest-action@v1
with:
inputs: artifacts.druid.gg/druid-team/druid:${{ inputs.version_tag }}-amd64,artifacts.druid.gg/druid-team/druid:${{ inputs.version_tag }}-arm64
tags: >-
artifacts.druid.gg/druid-team/druid:${{ inputs.version }},
artifacts.druid.gg/druid-team/druid:${{ inputs.version_tag }}${{ inputs.is_pr != true && ',artifacts.druid.gg/druid-team/druid:latest,artifacts.druid.gg/druid-team/druid:stable' || '' }}
push: true
docker-steamcmd:
needs: [docker-base-manifest, docker-base-manifest-artifacts]
uses: ./.github/workflows/docker-build-reusable.yml
with:
dockerfile: Dockerfile.steamcmd
tags: |
highcard/druid:${{ inputs.version_tag }}-steamcmd
artifacts.druid.gg/druid-team/druid:${{ inputs.version_tag }}-steamcmd
${{ inputs.is_pr != true && format('highcard/druid:latest-steamcmd') || '' }}
${{ inputs.is_pr != true && format('highcard/druid:stable-steamcmd') || '' }}
${{ inputs.is_pr != true && format('highcard/druid:{0}-steamcmd', inputs.version) || '' }}
${{ inputs.is_pr != true && format('artifacts.druid.gg/druid-team/druid:latest-steamcmd') || '' }}
${{ inputs.is_pr != true && format('artifacts.druid.gg/druid-team/druid:stable-steamcmd') || '' }}
${{ inputs.is_pr != true && format('artifacts.druid.gg/druid-team/druid:{0}-steamcmd', inputs.version) || '' }}
build_args: |
VERSION=${{ inputs.version_tag }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DRUID_ARTIFACTS_REGISTRY_USERNAME: ${{ secrets.DRUID_ARTIFACTS_REGISTRY_USERNAME }}
DRUID_ARTIFACTS_REGISTRY_TOKEN: ${{ secrets.DRUID_ARTIFACTS_REGISTRY_TOKEN }}