From 3fe1f5589a3e3b5b9048c103022a60ab0f0172f2 Mon Sep 17 00:00:00 2001 From: Ricardo Rosales Date: Fri, 24 Jun 2022 19:19:44 -0500 Subject: [PATCH] Build and push to public.ecr.aws/e5r9m0c5 --- .circleci/config.yml | 20 ---------------- .github/workflows/build_image.yml | 38 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 20 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build_image.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 744a498..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 2.1 - -orbs: - ivy-circleci-orb: nxtlytics/ivy-circleci-orb@0.0.5 - -workflows: - version: 2 - build: - jobs: - - ivy-circleci-orb/build_docker: - name: ivy-homebrew - simple_docker_tag: true - context: ivy - filters: - branches: - ignore: - - /.*/ - tags: - only: /^v.*/ - diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml new file mode 100644 index 0000000..59ac13b --- /dev/null +++ b/.github/workflows/build_image.yml @@ -0,0 +1,38 @@ +name: Build homebrew image + +on: + push: + tags: + - "v*" + +permissions: + id-token: write # required to use OIDC authentication + contents: read + +jobs: + build-and-push: + name: Build homebrew container and push to public ECR + runs-on: ubuntu-latest + steps: + - name: Get repo name + id: repoName + run: echo "::set-output name=reponame::$(echo ${{github.repository}} | cut -d '/' -f 2)" + - name: Get the version + id: get-version + run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) + - name: Checkout + uses: actions/checkout@v3 + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: arn:aws:iam::645843940509:role/github-actions-ecr-public-create-read-write + role-duration-seconds: 900 # Member must have value greater than or equal to 900 + aws-region: us-east-1 + # Using this until https://github.com/aws-actions/amazon-ecr-login/issues/116 + # is closed + - name: Build and Push to ECR public + id: build-and-push + uses: pahud/ecr-public-action@0db8adbcfd3c3ec2f604d70fdd6b5d15c80e1dbc + with: + tags: | + public.ecr.aws/e5r9m0c5/${{ steps.repoName.outputs.reponame }}:${{ steps.get-version.outputs.VERSION }}