Skip to content

Kerem/stream metadata worker prep (#1293) #527

Kerem/stream metadata worker prep (#1293)

Kerem/stream metadata worker prep (#1293) #527

# Based on https://github.com/docker/build-push-action
name: 'Build River Stress Test Node Docker Image'
on:
push:
branches:
- main
paths:
- 'packages/**'
workflow_dispatch:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CD_WORKFLOW_WEBHOOK_URL }}
jobs:
build:
name: Build docker image
runs-on: ubuntu-latest-8-cores
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-stress-test-node
run: |
docker build -t $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:latest . -f ./packages/stress-testing/Dockerfile
docker push $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:latest
# 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 Stress Test Node Docker Image",
"environment": "N/",
"branch": "${{ github.ref }}",
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"commit": "${{ github.sha }}",
"actor": "${{ github.actor }}"
}