Skip to content

Commit

Permalink
docker login
Browse files Browse the repository at this point in the history
  • Loading branch information
tadashi0713 committed Nov 18, 2024
1 parent 9bec8f1 commit 35ec855
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
AWS_REGION: 'ap-northeast-1'
AWS_ROLE_ARN: 'arn:aws:iam::175142243308:role/tadashi-docker-scout-demo-role'
ECR_REGISTRY: '175142243308.dkr.ecr.ap-northeast-1.amazonaws.com'
REPOSITORY: 'tadashi/docker-scout-demo'
ECR_REPOSITORY: 'tadashi/docker-scout-demo'
DOCKERHUB_REPOSITORY: 'tadashinemoto567/docker-scout-demo'
IMAGE_TAG: ${{ github.sha }}
DOCKER_SCOUT_HUB_USER: ${{ secrets.DOCKER_USERNAME }}
Expand All @@ -22,6 +22,10 @@ jobs:
id-token: write
contents: read
steps:
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
Expand All @@ -31,11 +35,11 @@ jobs:
registry: ${{ env.ECR_REGISTRY }}
- uses: docker/build-push-action@v6
with:
tags: ${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
- uses: docker/scout-action@v1
with:
command: environment
image: ${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
image: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
environment: staging
organization: tadashinemoto567

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:

env:
AWS_REPOSITORY: 'tadashi/docker-scout-demo'
ECR_REPOSITORY: 'tadashi/docker-scout-demo'
IMAGE_TAG: ${{ github.sha }}
DOCKER_SCOUT_HUB_USER: ${{ secrets.DOCKER_USERNAME }}
DOCKER_SCOUT_HUB_PASSWORD: ${{ secrets.DOCKER_TOKEN }}
Expand Down Expand Up @@ -46,11 +46,11 @@ jobs:
registry: ${{ env.ECR_REGISTRY }}
- uses: docker/build-push-action@v6
with:
tags: ${{ env.ECR_REGISTRY }}/${{ env.AWS_REPOSITORY }}:${{ env.IMAGE_TAG }}
tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
- id: docker-scout
uses: docker/scout-action@v1
with:
command: compare
image: ${{ env.AWS_REPOSITORY }}:${{ env.IMAGE_TAG }}
image: ${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
to-env: production
organization: tadashinemoto567

0 comments on commit 35ec855

Please sign in to comment.