Skip to content

Merge pull request #67 from stephengoldbaum/main #41

Merge pull request #67 from stephengoldbaum/main

Merge pull request #67 from stephengoldbaum/main #41

name: Publish Docker image
on:
workflow_dispatch: {}
push:
branches:
- 'main'
paths:
- 'src/**'
- 'morphir.json'
- 'package.json'
- 'elm.json'
- 'Dockerfile'
- '.github/workflows/publish-docker.yml'
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
if: github.repository_owner == 'finos'
outputs:
digest: ${{ steps.build_publish.outputs.digest }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: finos
password: ${{ secrets.DOCKER_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.1.1
with:
images: finos/lcr-interactive
tags: |
type=ref,event=branch
type=sha
- name: Build and push Docker image
id: build_publish
uses: docker/build-push-action@v3.2.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# publish_to_ecs:
# name: Update ECS Cluster
# runs-on: ubuntu-latest
# needs: push_to_registry
# steps:
# - name: Print out image digest
# run: echo ${{needs.push_to_registry.outputs.digest}}
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ secrets.AWS_REGION }}
# - name: Fill in the new image ID in the Amazon ECS task definition
# id: task-def
# uses: aws-actions/amazon-ecs-render-task-definition@v1
# with:
# task-definition: ecs-task-definition.json
# container-name: my-container
# image: "finos/lcr-interactive@sha256:${{needs.push_to_registry.outputs.digest}}"
# - name: Deploy to Amazon ECS
# uses: aws-actions/amazon-ecs-deploy-task-definition@v1.4.10
# with:
# task-definition: ${{ steps.task-def.outputs.task-definition }}
# service: morphir-lcr-interactive
# cluster: lcr-interactive
# wait-for-service-stability: true