@@ -43,95 +43,66 @@ jobs:
4343 bin/druid_rcon_web_rust
4444 .docker/entrypoint.sh
4545 .docker/druid-install-command.sh
46+
4647 docker-base :
47- runs-on : ubuntu-latest
4848 needs : build
49- strategy :
50- matrix :
51- include :
52- - dockerfile : Dockerfile
53- tag_suffix : " "
54- - dockerfile : Dockerfile.steamcmd
55- tag_suffix : " -steamcmd"
56- steps :
57- - uses : actions/checkout@v4
58- with :
59- fetch-depth : 0
60- - name : Set up Docker Buildx
61- uses : docker/setup-buildx-action@v3
62- - name : Login to Docker Hub
63- uses : docker/login-action@v3
64- with :
65- username : ${{ vars.DOCKERHUB_USERNAME }}
66- password : ${{ secrets.DOCKERHUB_TOKEN }}
67- - name : Login to Artifacts Registry
68- uses : docker/login-action@v3
69- with :
70- registry : artifacts.druid.gg
71- username : ${{ vars.DRUID_ARTIFACTS_REGISTRY_USERNAME }}
72- password : ${{ secrets.DRUID_ARTIFACTS_REGISTRY_TOKEN }}
73- # stable is still pretty bleeding edge at this point
74- - name : Build and push Docker image
75- uses : docker/build-push-action@v6
76- with :
77- context : .
78- file : ${{ matrix.dockerfile }}
79- tags : |
80- highcard/druid:latest${{ matrix.tag_suffix }}
81- highcard/druid:stable${{ matrix.tag_suffix }}
82- highcard/druid:${{ needs.build.outputs.version }}${{ matrix.tag_suffix }}
83- highcard/druid:${{ needs.build.outputs.version_tag }}${{ matrix.tag_suffix }}
84- artifacts.druid.gg/druid-team/druid:latest${{ matrix.tag_suffix }}
85- artifacts.druid.gg/druid-team/druid:stable${{ matrix.tag_suffix }}
86- artifacts.druid.gg/druid-team/druid:${{ needs.build.outputs.version }}${{ matrix.tag_suffix }}
87- artifacts.druid.gg/druid-team/druid:${{ needs.build.outputs.version_tag }}${{ matrix.tag_suffix }}
88- push : true
89- build-args : |
90- VERSION=${{ needs.build.outputs.version }}
91- GIT_COMMIT=${{ github.sha }}
92- GIT_BRANCH=${{ github.ref_name }}
49+ uses : ./.github/workflows/docker-build-reusable.yml
50+ with :
51+ dockerfile : Dockerfile
52+ tag_suffix : " "
53+ version : ${{ needs.build.outputs.version }}
54+ version_tag : ${{ needs.build.outputs.version_tag }}
55+ secrets :
56+ DOCKERHUB_USERNAME : ${{ vars.DOCKERHUB_USERNAME }}
57+ DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
58+ DRUID_ARTIFACTS_REGISTRY_USERNAME : ${{ vars.DRUID_ARTIFACTS_REGISTRY_USERNAME }}
59+ DRUID_ARTIFACTS_REGISTRY_TOKEN : ${{ secrets.DRUID_ARTIFACTS_REGISTRY_TOKEN }}
60+
61+ docker-steamcmd :
62+ needs : [build, docker-base]
63+ if : ${{ needs.build.outputs.version != '' }}
64+ uses : ./.github/workflows/docker-build-reusable.yml
65+ with :
66+ dockerfile : Dockerfile.steamcmd
67+ tag_suffix : " -steamcmd"
68+ version : ${{ needs.build.outputs.version }}
69+ version_tag : ${{ needs.build.outputs.version_tag }}
70+ secrets :
71+ DOCKERHUB_USERNAME : ${{ vars.DOCKERHUB_USERNAME }}
72+ DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
73+ DRUID_ARTIFACTS_REGISTRY_USERNAME : ${{ vars.DRUID_ARTIFACTS_REGISTRY_USERNAME }}
74+ DRUID_ARTIFACTS_REGISTRY_TOKEN : ${{ secrets.DRUID_ARTIFACTS_REGISTRY_TOKEN }}
9375
9476 docker-nix :
95- runs-on : ubuntu-latest
9677 needs : [build, docker-base]
97- strategy :
98- matrix :
99- include :
100- - base_tag_suffix : " "
101- tag_suffix : " -nix"
102- - base_tag_suffix : " -steamcmd"
103- tag_suffix : " -nix-steamcmd"
104- steps :
105- - uses : actions/checkout@v4
106- with :
107- fetch-depth : 0
108- - name : Set up Docker Buildx
109- uses : docker/setup-buildx-action@v3
110- - name : Login to Docker Hub
111- uses : docker/login-action@v3
112- with :
113- username : ${{ vars.DOCKERHUB_USERNAME }}
114- password : ${{ secrets.DOCKERHUB_TOKEN }}
115- - name : Login to Artifacts Registry
116- uses : docker/login-action@v3
117- with :
118- registry : artifacts.druid.gg
119- username : ${{ vars.DRUID_ARTIFACTS_REGISTRY_USERNAME }}
120- password : ${{ secrets.DRUID_ARTIFACTS_REGISTRY_TOKEN }}
121- - name : Build and push Nix Docker image
122- uses : docker/build-push-action@v6
123- with :
124- context : .
125- file : Dockerfile.nix
126- tags : |
127- highcard/druid:latest${{ matrix.tag_suffix }}
128- highcard/druid:stable${{ matrix.tag_suffix }}
129- highcard/druid:${{ needs.build.outputs.version }}${{ matrix.tag_suffix }}
130- highcard/druid:${{ needs.build.outputs.version_tag }}${{ matrix.tag_suffix }}
131- artifacts.druid.gg/druid-team/druid:latest${{ matrix.tag_suffix }}
132- artifacts.druid.gg/druid-team/druid:stable${{ matrix.tag_suffix }}
133- artifacts.druid.gg/druid-team/druid:${{ needs.build.outputs.version }}${{ matrix.tag_suffix }}
134- artifacts.druid.gg/druid-team/druid:${{ needs.build.outputs.version_tag }}${{ matrix.tag_suffix }}
135- push : true
136- build-args : |
137- VERSION=${{ needs.build.outputs.version }}${{ matrix.base_tag_suffix }}
78+ if : ${{ needs.build.outputs.version != '' }}
79+ uses : ./.github/workflows/docker-build-reusable.yml
80+ with :
81+ dockerfile : Dockerfile.nix
82+ tag_suffix : " -nix"
83+ version : ${{ needs.build.outputs.version }}
84+ version_tag : ${{ needs.build.outputs.version_tag }}
85+ base_tag_suffix : " "
86+ is_nix : true
87+ secrets :
88+ DOCKERHUB_USERNAME : ${{ vars.DOCKERHUB_USERNAME }}
89+ DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
90+ DRUID_ARTIFACTS_REGISTRY_USERNAME : ${{ vars.DRUID_ARTIFACTS_REGISTRY_USERNAME }}
91+ DRUID_ARTIFACTS_REGISTRY_TOKEN : ${{ secrets.DRUID_ARTIFACTS_REGISTRY_TOKEN }}
92+
93+ docker-nix-steamcmd :
94+ needs : [build, docker-steamcmd]
95+ if : ${{ needs.build.outputs.version != '' }}
96+ uses : ./.github/workflows/docker-build-reusable.yml
97+ with :
98+ dockerfile : Dockerfile.nix
99+ tag_suffix : " -nix-steamcmd"
100+ version : ${{ needs.build.outputs.version }}
101+ version_tag : ${{ needs.build.outputs.version_tag }}
102+ base_tag_suffix : " -steamcmd"
103+ is_nix : true
104+ secrets :
105+ DOCKERHUB_USERNAME : ${{ vars.DOCKERHUB_USERNAME }}
106+ DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
107+ DRUID_ARTIFACTS_REGISTRY_USERNAME : ${{ vars.DRUID_ARTIFACTS_REGISTRY_USERNAME }}
108+ DRUID_ARTIFACTS_REGISTRY_TOKEN : ${{ secrets.DRUID_ARTIFACTS_REGISTRY_TOKEN }}
0 commit comments