Skip to content

[v0.22.0] Docker Image Build and Push (Production) #20

[v0.22.0] Docker Image Build and Push (Production)

[v0.22.0] Docker Image Build and Push (Production) #20

name: Unstract Docker Image Build and Push (Production)
on:
release:
types:
- created
run-name: "[${{ github.event.release.tag_name }}] Docker Image Build and Push (Production)"
jobs:
build-and-push:
runs-on: custom-k8s-runner
strategy:
matrix:
service_name: [backend, frontend, document-service, platform-service, prompt-service, worker, x2text-service]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.release.tag_name }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push images
working-directory: ./docker
run: |
VERSION=${{ github.event.release.tag_name }} docker-compose -f docker-compose.build.yaml build --no-cache ${{ matrix.service_name }}
docker tag unstract/${{ matrix.service_name }}:${{ github.event.release.tag_name }} unstract/${{ matrix.service_name }}:latest
docker push unstract/${{ matrix.service_name }}:${{ github.event.release.tag_name }}
docker push unstract/${{ matrix.service_name }}:latest