diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml deleted file mode 100644 index 5ed31f486..000000000 --- a/.github/workflows/docker-build.yaml +++ /dev/null @@ -1,116 +0,0 @@ -name: Build and Publish Docker Image to ECR - -on: - push: - branches: [main, beta] - - workflow_dispatch: - inputs: - logLevel: - description: 'Log level' - required: true - default: 'warning' - tags: - description: 'Enter a reason for running this deploy' - required: true - -env: - AWS_REGION: eu-west-2 - -jobs: - build-and-push: - if: always() && (github.ref == 'refs/heads/main' || github.event_name == 'pull_request') - runs-on: codebuild-ctx-cortex-systems-prod-m365-mcp-${{ github.run_id }}-${{ github.run_attempt }} - permissions: - contents: write # to be able to publish a GitHub release - issues: write # to be able to comment on released issues - pull-requests: write # to be able to comment on released pull requests - id-token: write # to enable use of OIDC for npm provenance - - steps: - - name: Print Inputs - run: | - echo "Log level: ${{ github.event.inputs.logLevel }}" - echo "Tags: ${{ github.event.inputs.tags }}" - - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_ROLE_ARN }} - aws-region: ${{ env.AWS_REGION }} - - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 - with: - registries: '490004636127' - - - name: Login to Amazon ECR (Preprod) - id: login-ecr-preprod - uses: aws-actions/amazon-ecr-login@v2 - with: - registries: '557690582324' - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20.x' - - # - name: Install dependencies - # run: npm clean-install - - - name: Install semantic-release extra plugins - run: npm i -g pnpm && pnpm install -D semantic-release @semantic-release/changelog @semantic-release-plus/docker - - - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies - run: pnpm audit signatures - continue-on-error: true - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver-opts: image=public.ecr.aws/vend/moby/buildkit:buildx-stable-1 - version: latest - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ steps.login-ecr.outputs.registry }}/ctx-cortex-systems-prod-m365-mcp - tags: | - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - # Latest tag for default branch (main) - type=raw,value=latest,enable={{is_default_branch}} - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: . - push: false - load: true - # push: ${{ github.event_name != 'pull_request' }} # Only pushes container image when pushing to main or creating a tag - tags: ${{ steps.meta.outputs.tags }}, 490004636127.dkr.ecr.eu-west-2.amazonaws.com/ctx-cortex-systems-prod-m365-mcp:latest, ctx-cortex-systems-prod-m365-mcp:latest - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Push to Second ECR Registry - env: - ECR_REGISTRY: ${{ steps.login-ecr-preprod.outputs.registry }} - ECR_REPOSITORY: ctxpp-cortex-systems-preprod-m365-mcp - IMAGE_TAG: latest - run: | - docker tag ctx-cortex-systems-prod-m365-mcp:latest $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npx semantic-release