Skip to content

Commit dd8bf6e

Browse files
authored
chore: add Docker Image publishing to CI (#16)
1 parent 96cb2ff commit dd8bf6e

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ permissions:
1515
contents: read
1616
deployments: none
1717
issues: none
18-
packages: none
18+
packages: write
1919
pull-requests: none
2020
repository-projects: none
2121
security-events: none
@@ -166,10 +166,36 @@ jobs:
166166

167167
build:
168168
runs-on: ubuntu-20.04
169+
if: github.ref != 'refs/heads/main'
169170
steps:
170171
- uses: actions/checkout@v3
171172
- uses: actions/setup-go@v3
172173
with:
173174
go-version: "~1.20"
174175
- name: build image
175176
run: make -j build/image/envbox
177+
publish:
178+
runs-on: ubuntu-20.04
179+
if: github.ref == 'refs/heads/main'
180+
steps:
181+
- name: Docker Login
182+
uses: docker/login-action@v2
183+
with:
184+
registry: ghcr.io
185+
username: ${{ github.actor }}
186+
password: ${{ secrets.GITHUB_TOKEN }}
187+
188+
- uses: actions/checkout@v3
189+
190+
- uses: actions/setup-go@v3
191+
with:
192+
go-version: "~1.20"
193+
194+
- name: build image
195+
run: make -j build/image/envbox
196+
197+
- name: tag image
198+
run: docker tag envbox ghcr.io/coder/envbox:latest
199+
200+
- name: push image
201+
run: docker push ghcr.io/coder/envbox:latest

deploy/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ FROM ubuntu:focal
44
# Copy configuration files to appropriate locations
55
COPY files /
66

7+
LABEL \
8+
org.opencontainers.image.title="Envbox" \
9+
org.opencontainers.image.url="https://github.com/coder/envbox" \
10+
org.opencontainers.image.source="https://github.com/coder/envbox" \
11+
org.opencontainers.image.description="Run Docker in Docker in Kubernetes"
12+
713
# Basic utilities
814
ARG DEBIAN_FRONTEND=noninteractive
915
# Ignore other repositories, as some require HTTPS

0 commit comments

Comments
 (0)