Skip to content

feat/test GHA to devnet ECR #4

feat/test GHA to devnet ECR

feat/test GHA to devnet ECR #4

Workflow file for this run

name: Build and Push ao/server images to ECR when raising a PR
on:
pull_request:
branches:
- '*'
jobs:
login:
runs-on: ubuntu-latest
outputs:
ecr_login: ${{ steps.login-ecr.outputs.ecr_login }}
steps:
- name: Log in to Amazon ECR
id: login-devnet-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: true
skip-logout: true
registry-type: private
registry: ${{ secrets.AWS_ACCOUNT_ID_AO_DEVNET }}.dkr.ecr.${{ secrets.AWS_REGION_AO_DEVNET }}.amazonaws.com
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_AO_DEVNET }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_AO_DEVNET }}
AWS_REGION: ${{ secrets.AWS_REGION_AO_DEVNET }}
build-and-push-cu:
needs: login
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Extract shortened commit hash
id: vars
run: echo "COMMIT_HASH=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
- name: Build and push CU Docker image
run: |
docker build -t ${{ secrets.AWS_ACCOUNT_ID_AO_DEVNET }}.dkr.ecr.${{ secrets.AWS_REGION_AO_DEVNET }}.amazonaws.com/devnet-ecr:ao-cu-$COMMIT_HASH -f servers/cu/Dockerfile servers/cu/
docker push ${{ secrets.AWS_ACCOUNT_ID_AO_DEVNET }}.dkr.ecr.${{ secrets.AWS_REGION_AO_DEVNET }}.amazonaws.com/devnet-ecr:ao-cu-$COMMIT_HASH
build-and-push-mu:
needs: login
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Extract shortened commit hash
id: vars
run: echo "COMMIT_HASH=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
- name: Build and push MU Docker image
run: |
docker build -t ${{ secrets.AWS_ACCOUNT_ID_AO_DEVNET }}.dkr.ecr.${{ secrets.AWS_REGION_AO_DEVNET }}.amazonaws.com/devnet-ecr:ao-mu-$COMMIT_HASH -f servers/mu/Dockerfile servers/mu/
docker push ${{ secrets.AWS_ACCOUNT_ID_AO_DEVNET }}.dkr.ecr.${{ secrets.AWS_REGION_AO_DEVNET }}.amazonaws.com/devnet-ecr:ao-mu-$COMMIT_HASH
build-and-push-su:
needs: login
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Extract shortened commit hash
id: vars
run: echo "COMMIT_HASH=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
- name: Build and push SU Docker image
run: |
docker build -t ${{ secrets.AWS_ACCOUNT_ID_AO_DEVNET }}.dkr.ecr.${{ secrets.AWS_REGION_AO_DEVNET }}.amazonaws.com/devnet-ecr:ao-su-$COMMIT_HASH -f servers/su/Dockerfile.x86 servers/su/
docker push ${{ secrets.AWS_ACCOUNT_ID_AO_DEVNET }}.dkr.ecr.${{ secrets.AWS_REGION_AO_DEVNET }}.amazonaws.com/devnet-ecr:ao-su-$COMMIT_HASH