Skip to content

Commit a4632a1

Browse files
committed
Initial version: GitHub action to build the Cohere-Terrarium Docker iamge
1 parent 179d9cb commit a4632a1

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/dockerize.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: dockerize
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
workflow_dispatch:
9+
inputs:
10+
tag:
11+
description: 'Docker image tag'
12+
default: 'dev'
13+
14+
jobs:
15+
build:
16+
name: Publish Cohere Terrarium Docker Images
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
21+
steps:
22+
- name: Checkout Code
23+
uses: actions/checkout@v3
24+
with:
25+
# Get all history to correctly infer Khoj version using hatch
26+
fetch-depth: 0
27+
28+
- name: 🧹 Delete huge unnecessary tools folder
29+
run: rm -rf /opt/hostedtoolcache
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v2
33+
34+
- name: Login to GitHub Container Registry
35+
uses: docker/login-action@v2
36+
with:
37+
registry: ghcr.io
38+
username: ${{ github.repository_owner }}
39+
password: ${{ secrets.PAT }}
40+
41+
- name: 🧹 Delete huge unnecessary tools folder
42+
run: rm -rf /opt/hostedtoolcache
43+
44+
- name: 📦️⛅️ Build and Push Cloud Docker Image
45+
uses: docker/build-push-action@v2
46+
with:
47+
context: .
48+
file: Dockerfile
49+
platforms: linux/amd64, linux/arm64
50+
push: true
51+
tags: |
52+
ghcr.io/${{ github.repository }}:latest
53+
${{ github.ref_type == 'tag' && format('ghcr.io/{0}:latest', github.repository) || '' }}

0 commit comments

Comments
 (0)