Skip to content

Commit

Permalink
modify ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tadashi0713 committed Nov 18, 2024
1 parent 4bce096 commit aad63c7
Showing 1 changed file with 5 additions and 32 deletions.
37 changes: 5 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,27 @@ on:
pull_request:

env:
ECR_REPOSITORY: 'tadashi/docker-scout-demo'
IMAGE_TAG: ${{ github.sha }}
DOCKER_SCOUT_HUB_USER: ${{ secrets.DOCKER_USERNAME }}
DOCKER_SCOUT_HUB_PASSWORD: ${{ secrets.DOCKER_TOKEN }}
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'
DOCKERHUB_REPOSITORY: 'tadashinemoto567/docker-scout-demo'

jobs:
scout:
# runs-on: ubuntu-latest
# permissions:
# pull-requests: write
# steps:
# - uses: docker/setup-buildx-action@v3
# - uses: docker/build-push-action@v6
# with:
# push: false
# load: true
# tags: ${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
# - id: docker-scout
# uses: docker/scout-action@v1
# with:
# command: compare
# image: ${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
# to-env: production
# organization: tadashinemoto567
runs-on: ubuntu-latest
permissions:
pull-requests: write
id-token: write
contents: read
steps:
- uses: docker/setup-buildx-action@v3
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
- uses: docker/login-action@v3
with:
registry: ${{ env.ECR_REGISTRY }}
- uses: docker/build-push-action@v6
with:
tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
push: false
load: true
tags: ${{ env.DOCKERHUB_REPOSITORY }}:${{ env.IMAGE_TAG }}
- id: docker-scout
uses: docker/scout-action@v1
with:
command: compare
image: ${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
image: ${{ env.DOCKERHUB_REPOSITORY }}:${{ env.IMAGE_TAG }}
to-env: production
organization: tadashinemoto567

0 comments on commit aad63c7

Please sign in to comment.