Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

build: publish docker images on merge to main

Brad Barbine13ad6fdcd8e
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
new file mode 100644
index 0000000000..3110a73a13
--- /dev/null
+++ b/.github/workflows/docker-publish.yml
@@ -0,0 +1,52 @@
+name: Build and Publish Docker Images
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - "apps/erp/**"
+ - "apps/mes/**"
+ - "packages/**"
+ workflow_dispatch:
+
+env:
+ AWS_REGION: us-gov-east-1
+
+jobs:
+ build-and-publish:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ app: [erp, mes]
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Configure AWS credentials
+ uses: aws-actions/configure-aws-credentials@v4
+ with:
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
+ aws-region: ${{ env.AWS_REGION }}
+
+ - name: Login to Amazon ECR
+ id: login-ecr
+ uses: aws-actions/amazon-ecr-login@v2
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Build and push Docker image
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ file: ./apps/${{ matrix.app }}/Dockerfile
+ push: true
+ tags: |
+ ${{ steps.login-ecr.outputs.registry }}/carbon/${{ matrix.app }}:latest
+ ${{ steps.login-ecr.outputs.registry }}/carbon/${{ matrix.app }}:${{ github.sha }}
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
+ platforms: linux/amd64