Maintain docker images in ECR repo #200
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Maintain docker images in ECR repo | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
pull_push_images: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set color | |
id: image-version | |
run: | | |
content=$(curl -sS "https://hub.docker.com/v2/repositories/browsers/edge/tags") | |
version=`echo $content | jq -r '.results[].name | select(contains("latest") | not)' | head -n 1` | |
echo "Latest Edge version is $version" | |
echo "edge=$version" >> $GITHUB_OUTPUT | |
content=$(curl -sS "https://hub.docker.com/v2/repositories/browsers/chrome/tags") | |
version=`echo $content | jq -r '.results[].name | select(contains("latest") | not)' | head -n 1` | |
echo "Latest Chrome version is $version" | |
echo "chrome=$version" >> $GITHUB_OUTPUT | |
content=$(curl -sS "https://hub.docker.com/v2/repositories/browsers/firefox/tags") | |
version=`echo $content | jq -r '.results[].name | select(contains("latest") | not)' | head -n 1` | |
echo "Latest Firefox version is $version" | |
echo "firefox=$version" >> $GITHUB_OUTPUT | |
content=$(curl -sS "https://hub.docker.com/v2/repositories/browsers/opera/tags") | |
version=`echo $content | jq -r '.results[].name | select(contains("latest") | not)' | head -n 1` | |
echo "Latest Opera version is $version" | |
echo "opera=$version" >> $GITHUB_OUTPUT | |
content=$(curl -sS "https://hub.docker.com/v2/repositories/browsers/safari/tags") | |
version=`echo $content | jq -r '.results[].name | select(contains("latest") | not)' | head -n 1` | |
echo "Latest Safari version is $version" | |
echo "safari=$version" >> $GITHUB_OUTPUT | |
content=$(curl -sS "https://hub.docker.com/v2/repositories/aerokube/selenoid-ui/tags") | |
version=`echo $content | jq -r '.results[].name | select(contains("latest") | not)' | head -n 1` | |
echo "Latest Selenoid-UI version is $version" | |
echo "selenoid-ui=$version" >> $GITHUB_OUTPUT | |
content=$(curl -sS "https://hub.docker.com/v2/repositories/aerokube/selenoid/tags") | |
version=`echo $content | jq -r '.results[].name | select(contains("latest") | not)' | head -n 1` | |
echo "Latest Selenoid version is $version" | |
echo "selenoid=$version" >> $GITHUB_OUTPUT | |
content=$(curl -sS "https://hub.docker.com/v2/repositories/aerokube/ggr-ui/tags") | |
version=`echo $content | jq -r '.results[].name | select(contains("latest") | not)' | head -n 1` | |
echo "Latest GGR-UI version is $version" | |
echo "ggr-ui=$version" >> $GITHUB_OUTPUT | |
content=$(curl -sS "https://hub.docker.com/v2/repositories/aerokube/ggr/tags") | |
version=`echo $content | jq -r '.results[].name | select(contains("latest") | not)' | head -n 1` | |
echo "Latest ggr version is $version" | |
echo "ggr=$version" >> $GITHUB_OUTPUT | |
content=$(curl -sS "https://hub.docker.com/v2/repositories/selenoid/video-recorder/tags") | |
version=`echo $content | jq -r '.results[].name | select(contains("latest") | not)' | head -n 1` | |
echo "Latest Video Recorder version is $version" | |
echo "video-recorder=$version" >> $GITHUB_OUTPUT | |
- name: Pull Docker Image and Push to AWS ECR | |
run: | | |
which curl | |
which jq | |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws configure set default.region us-east-1 | |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/orienlabs | |
version=${{ steps.image-version.outputs.edge }} | |
docker pull docker.io/browsers/edge:$version | |
docker tag docker.io/browsers/edge:$version public.ecr.aws/orienlabs/browsers/edge:$version | |
docker tag docker.io/browsers/edge:$version public.ecr.aws/orienlabs/browsers/edge:latest | |
docker push public.ecr.aws/orienlabs/browsers/edge:$version | |
docker push public.ecr.aws/orienlabs/browsers/edge:latest | |
version=${{ steps.image-version.outputs.chrome }} | |
docker pull docker.io/browsers/chrome:$version | |
docker tag docker.io/browsers/chrome:$version public.ecr.aws/orienlabs/browsers/chrome:$version | |
docker tag docker.io/browsers/chrome:$version public.ecr.aws/orienlabs/browsers/chrome:latest | |
docker push public.ecr.aws/orienlabs/browsers/chrome:$version | |
docker push public.ecr.aws/orienlabs/browsers/chrome:latest | |
version=${{ steps.image-version.outputs.firefox }} | |
docker pull docker.io/browsers/firefox:$version | |
docker tag docker.io/browsers/firefox:$version public.ecr.aws/orienlabs/browsers/firefox:$version | |
docker tag docker.io/browsers/firefox:$version public.ecr.aws/orienlabs/browsers/firefox:latest | |
docker push public.ecr.aws/orienlabs/browsers/firefox:$version | |
docker push public.ecr.aws/orienlabs/browsers/firefox:latest | |
version=${{ steps.image-version.outputs.opera }} | |
docker pull docker.io/browsers/opera:$version | |
docker tag docker.io/browsers/opera:$version public.ecr.aws/orienlabs/browsers/opera:$version | |
docker tag docker.io/browsers/opera:$version public.ecr.aws/orienlabs/browsers/opera:latest | |
docker push public.ecr.aws/orienlabs/browsers/opera:$version | |
docker push public.ecr.aws/orienlabs/browsers/opera:latest | |
version=${{ steps.image-version.outputs.safari }} | |
docker pull docker.io/browsers/safari:$version | |
docker tag docker.io/browsers/safari:$version public.ecr.aws/orienlabs/browsers/safari:$version | |
docker tag docker.io/browsers/safari:$version public.ecr.aws/orienlabs/browsers/safari:latest | |
docker push public.ecr.aws/orienlabs/browsers/safari:$version | |
docker push public.ecr.aws/orienlabs/browsers/safari:latest | |
version=${{ steps.image-version.outputs.selenoid-ui }} | |
docker pull docker.io/aerokube/selenoid-ui:$version | |
docker tag docker.io/aerokube/selenoid-ui:$version public.ecr.aws/orienlabs/selenoid-ui:$version | |
docker tag docker.io/aerokube/selenoid-ui:$version public.ecr.aws/orienlabs/selenoid-ui:latest | |
docker push public.ecr.aws/orienlabs/selenoid-ui:$version | |
docker push public.ecr.aws/orienlabs/selenoid-ui:latest | |
version=${{ steps.image-version.outputs.selenoid }} | |
docker pull docker.io/aerokube/selenoid:$version | |
docker tag docker.io/aerokube/selenoid:$version public.ecr.aws/orienlabs/selenoid:$version | |
docker tag docker.io/aerokube/selenoid:$version public.ecr.aws/orienlabs/selenoid:latest | |
docker push public.ecr.aws/orienlabs/selenoid:$version | |
docker push public.ecr.aws/orienlabs/selenoid:latest | |
version=${{ steps.image-version.outputs.ggr-ui }} | |
docker pull docker.io/aerokube/ggr-ui:$version | |
docker tag docker.io/aerokube/ggr-ui:$version public.ecr.aws/orienlabs/ggr-ui:$version | |
docker tag docker.io/aerokube/ggr-ui:$version public.ecr.aws/orienlabs/ggr-ui:latest | |
docker push public.ecr.aws/orienlabs/ggr-ui:$version | |
docker push public.ecr.aws/orienlabs/ggr-ui:latest | |
version=${{ steps.image-version.outputs.ggr }} | |
docker pull docker.io/aerokube/ggr:$version | |
docker tag docker.io/aerokube/ggr:$version public.ecr.aws/orienlabs/ggr:$version | |
docker tag docker.io/aerokube/ggr:$version public.ecr.aws/orienlabs/ggr:latest | |
docker push public.ecr.aws/orienlabs/ggr:$version | |
docker push public.ecr.aws/orienlabs/ggr:latest | |
version=${{ steps.image-version.outputs.video-recorder }} | |
docker pull docker.io/selenoid/video-recorder:$version | |
docker tag docker.io/selenoid/video-recorder:$version public.ecr.aws/orienlabs/video-recorder:$version | |
docker tag docker.io/selenoid/video-recorder:$version public.ecr.aws/orienlabs/video-recorder:latest | |
docker push public.ecr.aws/orienlabs/video-recorder:$version | |
docker push public.ecr.aws/orienlabs/video-recorder:latest | |
- name: 'Login via Azure CLI' | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: 'Login to browsers.azurecr.io' | |
uses: azure/docker-login@v1 | |
with: | |
login-server: browsers.azurecr.io | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Push Browser Images to Azure ECR | |
run: | | |
version=${{ steps.image-version.outputs.edge }} | |
echo "Latest Edge version is $version" | |
docker tag docker.io/browsers/edge:$version browsers.azurecr.io/edge:$version | |
docker tag docker.io/browsers/edge:$version browsers.azurecr.io/edge:latest | |
docker push browsers.azurecr.io/edge:$version | |
docker push browsers.azurecr.io/edge:latest | |
version=${{ steps.image-version.outputs.chrome }} | |
echo "Latest Chrome version is $version" | |
docker tag docker.io/browsers/chrome:$version browsers.azurecr.io/chrome:$version | |
docker tag docker.io/browsers/chrome:$version browsers.azurecr.io/chrome:latest | |
docker push browsers.azurecr.io/chrome:$version | |
docker push browsers.azurecr.io/chrome:latest | |
version=${{ steps.image-version.outputs.firefox }} | |
echo "Latest Firefox version is $version" | |
docker tag docker.io/browsers/firefox:$version browsers.azurecr.io/firefox:$version | |
docker tag docker.io/browsers/firefox:$version browsers.azurecr.io/firefox:latest | |
docker push browsers.azurecr.io/firefox:$version | |
docker push browsers.azurecr.io/firefox:latest | |
version=${{ steps.image-version.outputs.opera }} | |
echo "Latest Opera version is $version" | |
docker tag docker.io/browsers/opera:$version browsers.azurecr.io/opera:$version | |
docker tag docker.io/browsers/opera:$version browsers.azurecr.io/opera:latest | |
docker push browsers.azurecr.io/opera:$version | |
docker push browsers.azurecr.io/opera:latest | |
version=${{ steps.image-version.outputs.safari }} | |
echo "Latest Safari version is $version" | |
docker tag docker.io/browsers/safari:$version browsers.azurecr.io/safari:$version | |
docker tag docker.io/browsers/safari:$version browsers.azurecr.io/safari:latest | |
docker push browsers.azurecr.io/safari:$version | |
docker push browsers.azurecr.io/safari:latest | |
- name: 'Login to orienlabs.azurecr.io' | |
uses: azure/docker-login@v1 | |
with: | |
login-server: orienlabs.azurecr.io | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Push Selenium Images to Azure ECR | |
run: | | |
version=${{ steps.image-version.outputs.selenoid-ui }} | |
echo "Latest Selenoid-UI version is $version" | |
docker tag docker.io/aerokube/selenoid-ui:$version orienlabs.azurecr.io/selenoid-ui:$version | |
docker tag docker.io/aerokube/selenoid-ui:$version orienlabs.azurecr.io/selenoid-ui:latest | |
docker push orienlabs.azurecr.io/selenoid-ui:$version | |
docker push orienlabs.azurecr.io/selenoid-ui:latest | |
version=${{ steps.image-version.outputs.selenoid }} | |
echo "Latest Selenoid version is $version" | |
docker tag docker.io/aerokube/selenoid:$version orienlabs.azurecr.io/selenoid:$version | |
docker tag docker.io/aerokube/selenoid:$version orienlabs.azurecr.io/selenoid:latest | |
docker push orienlabs.azurecr.io/selenoid:$version | |
docker push orienlabs.azurecr.io/selenoid:latest | |
version=${{ steps.image-version.outputs.ggr-ui }} | |
echo "Latest GGR-UI version is $version" | |
docker tag docker.io/aerokube/ggr-ui:$version orienlabs.azurecr.io/ggr-ui:$version | |
docker tag docker.io/aerokube/ggr-ui:$version orienlabs.azurecr.io/ggr-ui:latest | |
docker push orienlabs.azurecr.io/ggr-ui:$version | |
docker push orienlabs.azurecr.io/ggr-ui:latest | |
version=${{ steps.image-version.outputs.ggr }} | |
echo "Latest ggr version is $version" | |
docker tag docker.io/aerokube/ggr:$version orienlabs.azurecr.io/ggr:$version | |
docker tag docker.io/aerokube/ggr:$version orienlabs.azurecr.io/ggr:latest | |
docker push orienlabs.azurecr.io/ggr:$version | |
docker push orienlabs.azurecr.io/ggr:latest | |
version=${{ steps.image-version.outputs.video-recorder }} | |
echo "Latest Video Recorder version is $version" | |
docker tag docker.io/selenoid/video-recorder:$version orienlabs.azurecr.io/video-recorder:$version | |
docker tag docker.io/selenoid/video-recorder:$version orienlabs.azurecr.io/video-recorder:latest | |
docker push orienlabs.azurecr.io/video-recorder:$version | |
docker push orienlabs.azurecr.io/video-recorder:latest |