From a4632a10627bb451002b7fdc2ce5503d53225d39 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Mon, 28 Oct 2024 18:48:03 -0700 Subject: [PATCH 1/2] Initial version: GitHub action to build the Cohere-Terrarium Docker iamge --- .github/workflows/dockerize.yml | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/dockerize.yml diff --git a/.github/workflows/dockerize.yml b/.github/workflows/dockerize.yml new file mode 100644 index 0000000..c9f921e --- /dev/null +++ b/.github/workflows/dockerize.yml @@ -0,0 +1,53 @@ +name: dockerize + +on: + push: + branches: + - main + + workflow_dispatch: + inputs: + tag: + description: 'Docker image tag' + default: 'dev' + +jobs: + build: + name: Publish Cohere Terrarium Docker Images + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + # Get all history to correctly infer Khoj version using hatch + fetch-depth: 0 + + - name: 🧹 Delete huge unnecessary tools folder + run: rm -rf /opt/hostedtoolcache + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.PAT }} + + - name: 🧹 Delete huge unnecessary tools folder + run: rm -rf /opt/hostedtoolcache + + - name: 📦️⛅️ Build and Push Cloud Docker Image + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfile + platforms: linux/amd64, linux/arm64 + push: true + tags: | + ghcr.io/${{ github.repository }}:latest + ${{ github.ref_type == 'tag' && format('ghcr.io/{0}:latest', github.repository) || '' }} From 69d240b627cbf902f02c40fb7583e660ecffbba3 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Mon, 28 Oct 2024 19:08:09 -0700 Subject: [PATCH 2/2] Remove the comment on top of fetch-depth --- .github/workflows/dockerize.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/dockerize.yml b/.github/workflows/dockerize.yml index c9f921e..b69835e 100644 --- a/.github/workflows/dockerize.yml +++ b/.github/workflows/dockerize.yml @@ -22,7 +22,6 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 with: - # Get all history to correctly infer Khoj version using hatch fetch-depth: 0 - name: 🧹 Delete huge unnecessary tools folder