Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/sync-official-image-to-ecr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: sync-official-image-to-ecr

on:
workflow_dispatch:
inputs:
source_image:
description: 'Official image to mirror, e.g. sigp/lighthouse:v5.3.0'
required: true
default: 'sigp/lighthouse:latest'
ecr_tag:
description: 'Tag to push to 553885929720.dkr.ecr.us-east-1.amazonaws.com/lighthouse'
required: true

jobs:
mirror:
runs-on: ubuntu-22.04
steps:
- name: Pull official image
run: docker pull ${{ github.event.inputs.source_image }}

- name: Configure 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 ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Tag and push to ECR
run: |
TARGET="${{ steps.login-ecr.outputs.registry }}/lighthouse:${{ github.event.inputs.ecr_tag }}"
docker tag ${{ github.event.inputs.source_image }} "$TARGET"
docker push "$TARGET"
echo "Pushed $TARGET"
Loading