Skip to content

Commit

Permalink
added container registry ECR Public
Browse files Browse the repository at this point in the history
  • Loading branch information
yseto committed Feb 25, 2025
1 parent 676be04 commit 49d3d71
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/wf-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,29 @@ jobs:
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
if: inputs.needs-push
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Configure AWS Credentials
if: inputs.needs-push
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.ROLE_TO_ASSUME }}
role-session-name: "mackerel-container-agent-${{ github.run_id }}-${{ github.run_number }}"
aws-region: ap-northeast-1
- name: Login to Public ECR
if: inputs.needs-push
uses: docker/login-action@v3
with:
registry: public.ecr.aws
env:
AWS_REGION: us-east-1

- name: Get tag
id: get_tag
run: echo "tag=${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT"
Expand All @@ -35,3 +52,5 @@ jobs:
tags: |
mackerel/mackerel-agent:latest
mackerel/mackerel-agent:${{ steps.get_tag.outputs.tag }}
public.ecr.aws/mackerel/mackerel-agent:latest
public.ecr.aws/mackerel/mackerel-agent:${{ steps.get_tag.outputs.tag }}

0 comments on commit 49d3d71

Please sign in to comment.