From df8ade2917830a39114119ead3201c953b639268 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Wed, 16 Aug 2023 18:32:43 +0700 Subject: [PATCH] Build images on tag --- .github/workflows/on-push.yml | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index 3001285..9f97798 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -2,31 +2,23 @@ name: Build Docker images on master push on: push: - branch: - - master + tags: + - "*" jobs: - build_api: + build: runs-on: ubuntu-latest + strategy: + matrix: + services: + - api + - ui + env: + SERVICE_DIR: ./${{ matrix.service }} + IMAGE_NAME: ghcr.io/${{ github.repository }}-${{ matrix.service }} steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - run: docker login --username "${{ github.actor }}" --password ${{ secrets.GITHUB_TOKEN }} ghcr.io - run: docker buildx create --use - # 7B - - run: docker buildx build --platform linux/amd64,linux/arm64 -f ./api/Dockerfile --tag ghcr.io/getumbrel/llama-gpt-api-llama-2-7b-chat:${{ github.sha }} --push ./api - - run: docker buildx build --platform linux/amd64,linux/arm64 -f ./api/Dockerfile --tag ghcr.io/getumbrel/llama-gpt-api-llama-2-7b-chat:latest --push ./api - # 13B - # - run: docker buildx build --platform linux/amd64,linux/arm64 -f ./api/13B.Dockerfile --tag ghcr.io/getumbrel/llama-gpt-api-llama-2-13b-chat:${{ github.sha }} --push ./api - # - run: docker buildx build --platform linux/amd64,linux/arm64 -f ./api/13B.Dockerfile --tag ghcr.io/getumbrel/llama-gpt-api-llama-2-13b-chat:latest --push ./api - # 70B - # - run: docker buildx build --platform linux/amd64,linux/arm64 -f ./api/70B.Dockerfile --tag ghcr.io/getumbrel/llama-gpt-api-llama-2-70b-chat:${{ github.sha }} --push ./api - # - run: docker buildx build --platform linux/amd64,linux/arm64 -f ./api/70B.Dockerfile --tag ghcr.io/getumbrel/llama-gpt-api-llama-2-70b-chat:latest --push ./api - - build_ui: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - - run: docker login --username "${{ github.actor }}" --password ${{ secrets.GITHUB_TOKEN }} ghcr.io - - run: docker buildx create --use - - run: docker buildx build --platform linux/amd64,linux/arm64 -f ./ui/Dockerfile --tag ghcr.io/getumbrel/llama-gpt-ui:${{ github.sha }} --push ./ui - - run: docker buildx build --platform linux/amd64,linux/arm64 -f ./ui/Dockerfile --tag ghcr.io/getumbrel/llama-gpt-ui:latest --push ./ui + - run: docker buildx build --platform linux/amd64,linux/arm64 -f ${SERVICE_DIR}/Dockerfile --tag $IMAGE_NAME:${{ github.ref_name }}} --push ${SERVICE_DIR} + - run: docker buildx build --platform linux/amd64,linux/arm64 -f ${SERVICE_DIR}/Dockerfile --tag $IMAGE_NAME:latest --push ${SERVICE_DIR}