Skip to content

Commit

Permalink
wip(.github): Trying buildx instead of docker compose
Browse files Browse the repository at this point in the history
Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
  • Loading branch information
creatorrr committed Apr 17, 2024
1 parent 3a1e622 commit 91c0198
Showing 1 changed file with 18 additions and 26 deletions.
44 changes: 18 additions & 26 deletions .github/workflows/push-to-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ on: [push]
# - "dev"

jobs:
Build-Push-Images-To-Docker-Hub:
Build-Push-Other-Images:
runs-on: ubuntu-latest
strategy:
matrix:
service-directory:
- gateway
- memory-store
# - model-serving

steps:
- uses: actions/checkout@v4
Expand All @@ -23,32 +29,18 @@ jobs:
username: julepai
password: "${{ secrets.DOCKER_HUB_PASSWORD }}"

- name: Cache Docker layers
uses: actions/cache@v3
- name: Build and push images
uses: docker/build-push-action@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: KengoTODA/actions-setup-docker-compose@main
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Build images
run: |
touch .env
docker compose build --cache-from type=local,src=/tmp/.buildx-cache
docker compose build --cache-to type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Push images
run: |
docker compose push
context: ./${{ matrix.service-directory }}
push: true
tags: julepai/${{ matrix.service-directory }}:${{ github.ref_name }}
cache-from: type=gha
cache-to: type=gha,mode=max
# cache-from: |
# type=registry,ref=julepai/${{ matrix.service-directory }}:${{ github.ref_name }}
# type=registry,ref=julepai/${{ matrix.service-directory }}:dev
# cache-to: type=inline

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down

0 comments on commit 91c0198

Please sign in to comment.