Multi-Registry Image Sync #62
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: Multi-Registry Image Sync | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
sync_images: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- 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 Amazon ECR Public | |
id: login-ecr-public | |
uses: aws-actions/amazon-ecr-login@v2 | |
with: | |
registry-type: 'public' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update && sudo apt-get install -y python3-pip | |
pip3 install yq | |
curl -LO https://github.com/oras-project/oras/releases/download/v1.2.0/oras_1.2.0_linux_amd64.tar.gz | |
tar -zxvf oras_1.2.0_linux_amd64.tar.gz | |
sudo mv oras /usr/local/bin/ | |
chmod +x .github/scripts/sync_images.sh | |
- name: Execute the image sync script | |
run: | | |
./.github/scripts/sync_images.sh "${{ steps.login-ecr-public.outputs.registry }}" |