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 aws registry

Brad Barbinae021745a480
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
index aa03fc134a..3110a73a13 100644
--- a/.github/workflows/docker-publish.yml
+++ b/.github/workflows/docker-publish.yml
@@ -11,8 +11,7 @@ on:
workflow_dispatch:
env:
- REGISTRY: ghcr.io
- IMAGE_NAME: ${{ github.repository }}
+ AWS_REGION: us-gov-east-1
jobs:
build-and-publish:
@@ -20,43 +19,34 @@ jobs:
strategy:
matrix:
app: [erp, mes]
- permissions:
- contents: read
- packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- - name: Log in to Container Registry
- uses: docker/login-action@v3
+ - name: Configure AWS credentials
+ uses: aws-actions/configure-aws-credentials@v4
with:
- registry: ${{ env.REGISTRY }}
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
+ 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: 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.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
+ 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