diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..bbb8ca3 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,33 @@ +name: Publish +on: + push: + tags: + - v** +jobs: + publish-ecr: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + steps: + - name: configure aws credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: arn:aws:iam::558830342743:role/PublishCleanerController + role-session-name: github-actions-from-cleaner-controller + 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: Build, tag, and push docker image to Amazon ECR Public + env: + REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} + REGISTRY_ALIAS: my-ecr-public-registry-alias + REPOSITORY: my-ecr-public-repo + IMAGE_TAG: ${{ github.sha }} + run: | + echo $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG + +