Skip to content

Commit

Permalink
update CI (ECR pushing)
Browse files Browse the repository at this point in the history
  • Loading branch information
sclaw committed Oct 24, 2024
1 parent 6e5586b commit 8542619
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/papi-sync.yml → .github/workflows/ecr-push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PAPI Docker image build and publish
name: Docker image build and publish
on:
push:
branches:
Expand All @@ -16,7 +16,6 @@ jobs:

outputs:
image_tag: ${{ steps.build-publish.outputs.image_tag }}
full_image: ${{ steps.build-publish.outputs.full_image }}

steps:
- name: Checkout repo
Expand All @@ -28,16 +27,6 @@ jobs:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_NUMBER }}:role/${{ secrets.AWS_ROLE }}
role-session-name: updateimage
aws-region: ${{ secrets.AWS_REGION }}

- name: prepare ECR repo name based on the Github repository
shell: bash
run: |
set -eux
# lowercase the name
repo="${GITHUB_REPOSITORY,,}"
# replace / with _
echo "ECR_REPO_NAME=${repo//\//_}" >> $GITHUB_ENV

- name: Login to Amazon ECR
id: login-ecr
Expand All @@ -49,8 +38,8 @@ jobs:
id: build-publish
shell: bash
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ env.ECR_REPO_NAME }}
ECR_REGISTRY: "public.ecr.aws/dewberry"
ECR_REPOSITORY: ${{ secrets.ECR_REPO_NAME }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build . -t "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
Expand Down

0 comments on commit 8542619

Please sign in to comment.