File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1414 description : " Docker image tag"
1515 value : ${{ jobs.docker-build.outputs.image-tag }}
1616
17+ permissions :
18+ contents : read
19+ packages : write
20+ id-token : write
21+
1722env :
1823 MONGO_URI : ${{ secrets.MONGO_URI }}
1924 MONGO_USERNAME : ${{ secrets.MONGO_USERNAME }}
@@ -43,15 +48,15 @@ jobs:
4348 uses : docker/login-action@v3
4449 with :
4550 registry : ghcr.io
46- username : ${{ github.repository_owner }}
51+ username : ${{ github.actor }}
4752 password : ${{ secrets.GITHUB_TOKEN }}
4853
4954 - name : Build Docker Image
5055 uses : docker/build-push-action@v6
5156 with :
5257 push : false
5358 tags : |
54- ghcr.io/${{ secrets.DOCKER_USERNAME }}/solar-system :${{ github.sha }}
59+ ghcr.io/${{ secrets.DOCKER_USERNAME }}/graduation-project-devops :${{ github.sha }}
5560
5661 - name : Test Docker Image
5762 run : |
6368 -e MONGO_URI=${{ secrets.MONGO_URI }} \
6469 -e MONGO_USERNAME=${{ secrets.MONGO_USERNAME }} \
6570 -e MONGO_PASSWORD=${{ secrets.MONGO_PASSWORD }} \
66- ghcr.io/${{ secrets.DOCKER_USERNAME }}/solar-system :${{ github.sha }}
71+ ghcr.io/${{ secrets.DOCKER_USERNAME }}/graduation-project-devops :${{ github.sha }}
6772
6873 # Wait for container to start
6974 sleep 15
98103 push : true
99104 tags : |
100105 docker.io/${{ secrets.DOCKER_USERNAME }}/solar-system:${{ github.sha }}
101- ghcr.io/${{ secrets.DOCKER_USERNAME }}/solar-system :${{ github.sha }}
106+ ghcr.io/${{ secrets.DOCKER_USERNAME }}/graduation-project-devops :${{ github.sha }}
Original file line number Diff line number Diff line change 3131permissions :
3232 contents : read
3333 packages : write
34+ id-token : write
3435
3536jobs :
3637 ci :
4344 name : Build Docker Image
4445 if : ${{ !inputs.skip-docker && (success() || inputs.skip-tests) }}
4546 needs : [ci]
47+ permissions :
48+ contents : read
49+ packages : write
50+ id-token : write
4651 uses : ./.github/workflows/docker.yml
4752 secrets : inherit
4853 with :
You can’t perform that action at this time.
0 commit comments