Mirror Image #3
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: Mirror Image | |
on: | |
workflow_call: | |
inputs: | |
image: | |
required: true | |
type: string | |
workflow_dispatch: | |
inputs: | |
image: | |
description: "org/image:tag" | |
required: true | |
type: string | |
jobs: | |
mirror: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
steps: | |
- id: strip | |
run: | | |
TAG=${{ inputs.image }} | |
echo "image=${TAG##*/}" >> $GITHUB_OUTPUT | |
- name: configure aws credentials | |
uses: aws-actions/[email protected] | |
with: | |
role-to-assume: ${{ secrets.PROD_AWS_ROLE }} | |
aws-region: us-east-1 | |
- uses: docker/login-action@v3 | |
with: | |
registry: public.ecr.aws | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: akhilerm/[email protected] | |
with: | |
src: docker.io/${{ inputs.image }} | |
dst: | | |
public.ecr.aws/supabase/${{ steps.strip.outputs.image }} | |
ghcr.io/supabase/${{ steps.strip.outputs.image }} |