From aad7f32a211a67ff76e637e16205110d362265ea Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 28 Mar 2023 05:00:43 +0000 Subject: [PATCH 1/9] chore: add Docker Image publishing to CI --- .github/workflows/ci.yaml | 26 ++++++++++++++++++++++++++ deploy/Dockerfile | 6 ++++++ 2 files changed, 32 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b9e760c..a3d33b3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -166,6 +166,7 @@ jobs: build: runs-on: ubuntu-20.04 + if: github.ref != "refs/head/main" steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 @@ -173,3 +174,28 @@ jobs: go-version: "~1.20" - name: build image run: make -j build/image/envbox + publish: + runs-on: ubuntu-20.04 + if: github.ref == "refs/head/jon/imageci" + steps: + - name: Docker Login + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v3 + with: + go-version: "~1.20" + + - name: build image + run: make -j build/image/envbox + + - name: tag image + run: docker tag envbox ghcr.io/coder/envbox:latest + + - name: push image + run: docker push ghcr.io/coder/envbox:latest diff --git a/deploy/Dockerfile b/deploy/Dockerfile index fbba263..c81d6be 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -4,6 +4,12 @@ FROM ubuntu:focal # Copy configuration files to appropriate locations COPY files / +LABEL \ + org.opencontainers.image.title="Envbox" \ + org.opencontainers.image.url="https://github.com/coder/envbox" \ + org.opencontainers.image.source="https://github.com/coder/envbox" \ + org.opencontainers.image.description="Run Docker in Docker in Kubernetes" + # Basic utilities ARG DEBIAN_FRONTEND=noninteractive # Ignore other repositories, as some require HTTPS From 9a6e45634e8128331929199aa8d08a033f1ae160 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 28 Mar 2023 05:03:27 +0000 Subject: [PATCH 2/9] bad syntax --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a3d33b3..c06be9c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -176,7 +176,7 @@ jobs: run: make -j build/image/envbox publish: runs-on: ubuntu-20.04 - if: github.ref == "refs/head/jon/imageci" + if: github.ref == 'refs/head/jon/imageci' steps: - name: Docker Login uses: docker/login-action@v2 From 4713ae5383658969e5967fe400bee2ccc02f9630 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 28 Mar 2023 05:04:32 +0000 Subject: [PATCH 3/9] bad syntax --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c06be9c..d71d7d1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -166,7 +166,7 @@ jobs: build: runs-on: ubuntu-20.04 - if: github.ref != "refs/head/main" + if: github.ref != 'refs/head/main' steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 From aacd11dc195320ddb59dcdbe7f193f518b6db841 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 28 Mar 2023 05:05:37 +0000 Subject: [PATCH 4/9] update ref --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d71d7d1..7595715 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -166,7 +166,7 @@ jobs: build: runs-on: ubuntu-20.04 - if: github.ref != 'refs/head/main' + if: github.ref != 'refs/heads/main' steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 @@ -176,7 +176,7 @@ jobs: run: make -j build/image/envbox publish: runs-on: ubuntu-20.04 - if: github.ref == 'refs/head/jon/imageci' + if: github.ref == 'refs/heads/jon/imageci' steps: - name: Docker Login uses: docker/login-action@v2 From 74a996b369cf52ec4ec7e9de72dcb916ec4188da Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 28 Mar 2023 05:09:07 +0000 Subject: [PATCH 5/9] add test --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7595715..08a9cd5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,6 +39,8 @@ jobs: with: go-version: "~1.20" + - run: echo ${{ github.ref }} + name: "test" # Check for Go linting errors! - name: Lint Go uses: golangci/golangci-lint-action@v3.3.1 From e8a95cb953d210632f7868e66069299053bb7aee Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 28 Mar 2023 05:14:55 +0000 Subject: [PATCH 6/9] fix ref --- .github/workflows/ci.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 08a9cd5..bed6408 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,8 +39,6 @@ jobs: with: go-version: "~1.20" - - run: echo ${{ github.ref }} - name: "test" # Check for Go linting errors! - name: Lint Go uses: golangci/golangci-lint-action@v3.3.1 @@ -178,7 +176,7 @@ jobs: run: make -j build/image/envbox publish: runs-on: ubuntu-20.04 - if: github.ref == 'refs/heads/jon/imageci' + if: github.ref == 'refs/remotes/pull/16/merge' steps: - name: Docker Login uses: docker/login-action@v2 From e78a8c69de63d7e925191bcdd536e0dda7ad196b Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 28 Mar 2023 05:16:00 +0000 Subject: [PATCH 7/9] try again --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bed6408..472bfd4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -176,7 +176,7 @@ jobs: run: make -j build/image/envbox publish: runs-on: ubuntu-20.04 - if: github.ref == 'refs/remotes/pull/16/merge' + if: github.ref == 'refs/pull/16/merge' steps: - name: Docker Login uses: docker/login-action@v2 From 59fe82447e116ca6d3d326ddb66233c88bc32179 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 28 Mar 2023 05:16:18 +0000 Subject: [PATCH 8/9] push --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 472bfd4..73b659c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,7 +15,7 @@ permissions: contents: read deployments: none issues: none - packages: none + packages: write pull-requests: none repository-projects: none security-events: none From 854319069297e61af69dc5ad33fde414242152e5 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Tue, 28 Mar 2023 05:22:21 +0000 Subject: [PATCH 9/9] update to point to main --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 73b659c..856d3b5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -176,7 +176,7 @@ jobs: run: make -j build/image/envbox publish: runs-on: ubuntu-20.04 - if: github.ref == 'refs/pull/16/merge' + if: github.ref == 'refs/heads/main' steps: - name: Docker Login uses: docker/login-action@v2