diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index a7521762..4c0e4c99 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -12,7 +12,7 @@ permissions: contents: read jobs: - docker-image: + docker-monolith-image: runs-on: ubuntu-latest steps: - name: Checkout repo @@ -58,3 +58,66 @@ jobs: context: . file: docker/Dockerfile tags: briefercloud/briefer:${{ github.ref_name }},briefercloud/briefer:latest + + docker-multiple-images: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - name: 'web' + dockerfile: 'apps/web/Dockerfile' + context: '.' + - name: 'api' + dockerfile: 'apps/api/Dockerfile' + context: '.' + - name: 'ai' + dockerfile: 'ai/Dockerfile' + context: 'ai' + - name: 'jupyter' + context: 'apps/api' + dockerfile: 'apps/api/jupyter.Dockerfile' + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Set up Depot CLI + uses: depot/setup-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Is release version + id: tag_check + run: | + TAG=${GITHUB_REF#refs/tags/} + if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "is_release_version=true" >> $GITHUB_ENV + else + echo "is_release_version=false" >> $GITHUB_ENV + fi + + - name: Build and push tag + uses: depot/build-push-action@v1 + if: env.is_release_version == 'false' + with: + project: 6zxrst4dlr + platforms: linux/amd64,linux/arm64 + push: true + context: ${{ matrix.context }} + file: ${{ matrix.dockerfile }} + tags: briefercloud/briefer-${{ matrix.name }}:${{ github.ref_name }} + + - name: Build and push tag and release + uses: depot/build-push-action@v1 + if: env.is_release_version == 'true' + with: + project: 6zxrst4dlr + platforms: linux/amd64,linux/arm64 + push: true + context: ${{ matrix.context }} + file: ${{ matrix.dockerfile }} + tags: briefercloud/briefer-${{ matrix.name }}:${{ github.ref_name }},briefercloud/briefer-${{ matrix.name }}:latest diff --git a/apps/api/package.json b/apps/api/package.json index 85ba20c5..fd702eec 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -1,6 +1,6 @@ { "name": "@briefer/api", - "version": "0.0.1", + "version": "0.0.2-alpha", "private": true, "type": "module", "scripts": { diff --git a/docker-compose.yaml b/docker-compose.yaml index d59fba75..17dd096e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,6 +18,7 @@ services: - postgres_data:/var/lib/postgresql/data db_migration: + image: briefercloud/briefer-api build: context: '.' dockerfile: 'apps/api/Dockerfile' @@ -31,6 +32,7 @@ services: condition: service_healthy jupyter_server: + image: briefercloud/briefer-jupyter labels: 'cloud.briefer.jupyter-container': 'true' build: @@ -52,6 +54,7 @@ services: retries: 5 ai: + image: briefercloud/briefer-ai build: context: 'ai' dockerfile: 'Dockerfile' @@ -69,6 +72,7 @@ services: retries: 5 web: + image: briefercloud/briefer-web build: context: '.' dockerfile: 'apps/web/Dockerfile' @@ -84,6 +88,7 @@ services: condition: service_healthy api: + image: briefercloud/briefer-api build: context: '.' dockerfile: 'apps/api/Dockerfile'