Skip to content

Testing - Swift & PHP - Minor changes to Dockerfiles to support automated testing #486

Testing - Swift & PHP - Minor changes to Dockerfiles to support automated testing

Testing - Swift & PHP - Minor changes to Dockerfiles to support automated testing #486

Workflow file for this run

name: Docker Image CI
permissions:
packages: write
contents: read
id-token: write
on:
pull_request_target:
types:
- closed
branches:
- 'weathertop'
jobs:
push_to_registry:
if: github.event.pull_request.merged == true
env:
REGISTRY: public.ecr.aws
REGISTRY_ALIAS: b4v4v1s0
IMAGE_TAG: latest
REGION: us-east-1
name: Push Docker image to ECR Public
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
##################################################
################## ECR PUBLIC ####################
##################################################
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@master # More information on this action can be found below in the 'AWS Credentials' section
with:
role-to-assume: arn:aws:iam::808326389482:role/automation
aws-region: us-east-1
- name: Login to Amazon ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
###############################
###### Docker Image: #######
###### RUBY #######
###############################
- name: Build, tag, and push docker image to Amazon ECR Public - Ruby
if: contains(github.event.pull_request.labels.*.name, 'Ruby')
env:
REPOSITORY: ruby
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY/$REGISTRY_ALIAS
docker build -t $REPOSITORY -f ./$REPOSITORY/Dockerfile ./$REPOSITORY
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
continue-on-error: true
#################################
###### Docker Image: #######
###### PYTHON #######
#################################
- name: Build, tag, and push docker image to Amazon ECR Public - Python
if: contains(github.event.pull_request.labels.*.name, 'Python')
env:
REPOSITORY: python
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY/$REGISTRY_ALIAS
docker build -t $REPOSITORY -f ./$REPOSITORY/Dockerfile ./$REPOSITORY
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
continue-on-error: true
#################################
####### Docker Image: ########
####### JAVASCRIPT v3 ########
#################################
- name: Build, tag, and push docker image to Amazon ECR Public - JavaScript
if: contains(github.event.pull_request.labels.*.name, 'Javascript-v3')
env:
REPOSITORY: javascriptv3
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY/$REGISTRY_ALIAS
docker build -t $REPOSITORY -f ./$REPOSITORY/Dockerfile ./$REPOSITORY
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
continue-on-error: true
#################################
####### Docker Image: ########
####### RUST ########
#################################
- name: Build, tag, and push docker image to Amazon ECR Public - Rust
if: contains(github.event.pull_request.labels.*.name, 'Rust')
env:
REPOSITORY: rust_dev_preview
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY/$REGISTRY_ALIAS
docker build -t $REPOSITORY -f ./$REPOSITORY/Dockerfile ./$REPOSITORY
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
continue-on-error: true
#################################
####### Docker Image: ########
####### GO v2 ########
#################################
- name: Build, tag, and push docker image to Amazon ECR Public - GoLang
if: contains(github.event.pull_request.labels.*.name, 'Go-v2')
env:
REPOSITORY: gov2
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY/$REGISTRY_ALIAS
docker build -t $REPOSITORY -f ./$REPOSITORY/Dockerfile ./$REPOSITORY
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
continue-on-error: true
#################################
####### Docker Image: ########
####### C++ ########
#################################
- name: Build, tag, and push docker image to Amazon ECR Public - C++
if: contains(github.event.pull_request.labels.*.name, 'C++')
env:
REPOSITORY: cpp
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY/$REGISTRY_ALIAS
docker build -t $REPOSITORY -f ./$REPOSITORY/Dockerfile ./$REPOSITORY
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
continue-on-error: true
#################################
####### Docker Image: ########
####### .NET v3 ########
#################################
- name: Build, tag, and push docker image to Amazon ECR Public - .NET v3
if: contains(github.event.pull_request.labels.*.name, 'DotNet-v3')
env:
REPOSITORY: dotnetv3
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY/$REGISTRY_ALIAS
docker build -t $REPOSITORY -f ./$REPOSITORY/Dockerfile ./$REPOSITORY
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
continue-on-error: true
#################################
####### Docker Image: ########
####### JAVA v2 ########
#################################
- name: Build, tag, and push docker image to Amazon ECR Public - JavaV2
if: contains(github.event.pull_request.labels.*.name, 'Java-v2')
env:
REPOSITORY: javav2
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY/$REGISTRY_ALIAS
docker build -t $REPOSITORY -f ./$REPOSITORY/Dockerfile ./$REPOSITORY
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
continue-on-error: true
#################################
####### Docker Image: ########
####### KOTLIN ########
#################################
- name: Build, tag, and push docker image to Amazon ECR Public - Kotlin
if: contains(github.event.pull_request.labels.*.name, 'Kotlin')
env:
REPOSITORY: kotlin
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY/$REGISTRY_ALIAS
docker build -t $REPOSITORY -f ./$REPOSITORY/Dockerfile ./$REPOSITORY
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
continue-on-error: true
#################################
####### Docker Image: ########
####### PHP ########
#################################
- name: Build, tag, and push docker image to Amazon ECR Public - PHP
if: contains(github.event.pull_request.labels.*.name, 'PHP')
env:
REPOSITORY: php
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY/$REGISTRY_ALIAS
docker build -t $REPOSITORY -f ./$REPOSITORY/Dockerfile ./$REPOSITORY
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
continue-on-error: true
#################################
####### Docker Image: ########
####### SWIFT ########
#################################
- name: Build, tag, and push docker image to Amazon ECR Public - Swift
if: contains(github.event.pull_request.labels.*.name, 'Swift')
env:
REPOSITORY: swift
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY/$REGISTRY_ALIAS
docker build -t $REPOSITORY -f ./$REPOSITORY/Dockerfile ./$REPOSITORY
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
continue-on-error: true