Skip to content

Commit de18d5e

Browse files
committed
update workflow and template
1 parent e6ec40f commit de18d5e

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.github/workflows/dogfood.yaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
username: ${{ secrets.DOCKERHUB_USERNAME }}
4646
password: ${{ secrets.DOCKERHUB_PASSWORD }}
4747

48-
- name: Build and push
48+
- name: Build and push Non-Nix image
4949
uses: depot/build-push-action@v1
5050
with:
5151
project: b4q6ltmpzh
@@ -55,6 +55,17 @@ jobs:
5555
pull: true
5656
push: ${{ github.ref == 'refs/heads/main' }}
5757
tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest"
58+
59+
- name: Build and push Nix image
60+
uses: depot/build-push-action@v1
61+
with:
62+
project: b4q6ltmpzh
63+
token: ${{ secrets.DEPOT_TOKEN }}
64+
buildx-fallback: true
65+
context: "{{defaultContext}}:dogfood"
66+
pull: true
67+
push: ${{ github.ref == 'refs/heads/main' }}
68+
tags: "codercom/oss-dogfood-nix:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood-nix:latest"
5869

5970
deploy_template:
6071
needs: build_image

dogfood/main.tf

+5-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ locals {
3333

3434
repo_dir = replace(data.coder_parameter.repo_dir.value, "/^~\\//", "/home/coder/")
3535
container_name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}"
36-
registry_name = "codercom/oss-dogfood"
3736
jfrog_host = replace(var.jfrog_url, "https://", "")
3837
}
3938

@@ -45,20 +44,20 @@ data "coder_parameter" "repo_dir" {
4544
mutable = true
4645
}
4746

48-
data "coder_parameter" "image_tag" {
47+
data "coder_parameter" "image_type" {
4948
type = "string"
5049
name = "Coder Image"
51-
default = "latest"
50+
default = "codercom/oss-dogfood:latest"
5251
description = "The Docker image used to run your workspace. Choose between nix and non-nix images."
5352
option {
5453
icon = "/icon/coder.svg"
5554
name = "Non-Nix"
56-
value = "latest"
55+
value = "codercom/oss-dogfood:latest"
5756
}
5857
option {
5958
icon = "/icons/nix.svg"
6059
name = "Nix"
61-
value = "nix"
60+
value = "codercom/oss-dogfood-nix:latest"
6261
}
6362
}
6463

@@ -296,7 +295,7 @@ resource "docker_volume" "home_volume" {
296295
}
297296

298297
data "docker_registry_image" "dogfood" {
299-
name = "${local.registry_name}:${data.coder_parameter.image_tag.value}"
298+
name = "${data.coder_parameter.image_type.value}"
300299
}
301300

302301
resource "docker_image" "dogfood" {

0 commit comments

Comments
 (0)