File tree Expand file tree Collapse file tree 6 files changed +68
-24
lines changed
Expand file tree Collapse file tree 6 files changed +68
-24
lines changed Original file line number Diff line number Diff line change 1111 type : string
1212
1313env :
14- IMAGE_NAME : samanthamorris684/catbot
14+ REGISTRY : samanthamorris684
15+ IMAGE_NAME : catbot
1516 USERNAME : ${{ vars.DOCKERHUB_USERNAME }}
1617 PASSWORD : ${{ secrets.DOCKERHUB_TOKEN }}
1718
3031
3132 - name : Build and push the Docker image
3233 run : |
33- docker build -t $IMAGE_NAME:${{ inputs.IMAGE_TAG }} .
34- docker push $IMAGE_NAME:${{ inputs.IMAGE_TAG }}
35-
34+ docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.IMAGE_TAG }} .
35+ docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.IMAGE_TAG }}
3636
3737
3838
Original file line number Diff line number Diff line change 1515 type : string
1616
1717env :
18- IMAGE_NAME : samanthamorris684/catbot
18+ REGISTRY : samanthamorris684
19+ IMAGE_NAME : catbot
1920 EKS_CLUSTER_NAME : catbot-cluster
2021 NAMESPACE : cat-chatbot
2122
3637
3738 - name : Deploy to EKS
3839 run : |
39- kubectl set image deployment/server server=${{ env.IMAGE_NAME }}:${{ inputs.IMAGE_TAG }} -n ${{ env.NAMESPACE }}
40+ kubectl set image deployment/server server=${{ env.REGISTRY }}/${{ env. IMAGE_NAME }}:${{ inputs.IMAGE_TAG }} -n ${{ env.NAMESPACE }}
4041 kubectl rollout status deployment/server -n ${{ env.NAMESPACE }}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 44 push :
55 branches : main
66
7- env :
8- IMAGE_NAME : samanthamorris684/catbot
9-
107jobs :
118 build-and-push-image :
129 uses : ./.github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change 1+ name : Pull request workflow
2+
3+ on :
4+ pull_request
5+
6+ jobs :
7+ build-and-push-image :
8+ uses : ./.github/workflows/build-and-push.yml
9+ with :
10+ IMAGE_TAG : pr-${{ github.event.number }}
11+ secrets :
12+ DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
13+ scout :
14+ permissions :
15+ pull-requests : write
16+ needs : build-and-push-image
17+ uses : ./.github/workflows/scout.yml
18+ with :
19+ IMAGE_TAG : pr-${{ github.event.number }}
20+ secrets :
21+ DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : Security workflow
2+ on :
3+ workflow_call :
4+ secrets :
5+ DOCKERHUB_TOKEN :
6+ required : true
7+ inputs :
8+ IMAGE_TAG :
9+ required : true
10+ type : string
11+
12+ env :
13+ REGISTRY : samanthamorris684
14+ IMAGE_NAME : catbot
15+ # Change from latest
16+ COMPARE_TAG : latest
17+ USERNAME : ${{ vars.DOCKERHUB_USERNAME }}
18+ PASSWORD : ${{ secrets.DOCKERHUB_TOKEN }}
19+
20+ jobs :
21+ scout :
22+ runs-on : ubuntu-latest
23+ steps :
24+ - name : Log in to Docker Hub
25+ 26+ with :
27+ username : ${{ env.USERNAME }}
28+ password : ${{ env.PASSWORD }}
29+
30+ - name : Docker Scout
31+ id : docker-scout
32+ uses : docker/scout-action@v1
33+ with :
34+ command : compare
35+ image : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.IMAGE_TAG }}
36+ to : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.COMPARE_TAG }}
37+ ignore-unchanged : true
38+ only-severities : critical,high
39+ write-comment : true
40+ github-token : ${{ secrets.GITHUB_TOKEN }} # to be able to write the comment
You can’t perform that action at this time.
0 commit comments