Skip to content

wrap create space with prepay (#1282) #198

wrap create space with prepay (#1282)

wrap create space with prepay (#1282) #198

name: 'Build Stream Metadata Docker Image'
on:
push:
branches:
- main
paths:
- 'packages/stream-metadata/**'
- 'packages/**'
workflow_dispatch:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CD_WORKFLOW_WEBHOOK_URL }}
jobs:
build:
name: Build docker image
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup 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: us-east-1
- name: Login to Amazon ECR
id: login-aws-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: 'public'
- name: Build and push docker image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-aws-ecr.outputs.registry }}
#This can be custom alias once requested to aws and approved for public repo
REGISTRY_ALIAS: h5v6m2x1
ECR_REPOSITORY: river-stream-metadata
run: |
docker build \
--build-arg GIT_SHA=${{ github.sha }} \
-f ./packages/stream-metadata/Dockerfile \
-t $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:latest \
-t $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:${{ github.sha }} \
.
docker push $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:${{ github.sha }}
# If action failed, we send a slack notification
- name: Slack notification
if: failure()
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"step": "Build Stream Metadata Docker Image",
"environment": "N/",
"branch": "${{ github.ref }}",
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"commit": "${{ github.sha }}",
"actor": "${{ github.actor }}"
}