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 to github registry

Brad Barbin38fbfad87fd4
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
index 3110a73a13..aa03fc134a 100644
--- a/.github/workflows/docker-publish.yml
+++ b/.github/workflows/docker-publish.yml
@@ -11,7 +11,8 @@ on:
workflow_dispatch:
env:
- AWS_REGION: us-gov-east-1
+ REGISTRY: ghcr.io
+ IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-publish:
@@ -19,34 +20,43 @@ jobs:
strategy:
matrix:
app: [erp, mes]
+ permissions:
+ contents: read
+ packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- - name: Configure AWS credentials
- uses: aws-actions/configure-aws-credentials@v4
+ - name: Log in to Container Registry
+ uses: docker/login-action@v3
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
+ registry: ${{ env.REGISTRY }}
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
+ - name: Extract metadata
+ id: meta
+ uses: docker/metadata-action@v5
+ with:
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.app }}
+ tags: |
+ type=ref,event=branch
+ type=ref,event=pr
+ type=sha
+ type=raw,value=latest,enable={{is_default_branch}}
+
- 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 }}
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64