File tree Expand file tree Collapse file tree 1 file changed +9
-22
lines changed
Expand file tree Collapse file tree 1 file changed +9
-22
lines changed Original file line number Diff line number Diff line change 77 workflow_dispatch :
88
99permissions :
10- id-token : write
1110 contents : read
11+ packages : write
1212
1313jobs :
1414 build-and-push :
@@ -25,31 +25,18 @@ jobs:
2525 echo "IMAGE_TAG=dev" >> $GITHUB_ENV
2626 fi
2727
28- - name : AWS config
29- uses : aws-actions/configure-aws-credentials@v4
28+ - name : Login to Github Registry ghcr.io
29+ uses : docker/login-action@v3
3030 with :
31- role-to-assume : ${{ secrets.AWS_DEV_ROLE }}
32- role-session-name : GithubNGAGeointSession
33- aws-region : ${{ secrets.AWS_DEV_REGION }}
34-
35- - name : AWS ECR Login
36- id : ecr-login
37- uses : aws-actions/amazon-ecr-login@v2
31+ registry : ghcr.io
32+ username : ${{ github.actor }}
33+ password : ${{ secrets.GITHUB_TOKEN }}
3834
3935 - name : Build Docker image
40- env :
41- REGISTRY : ${{ steps.ecr-login.outputs.registry }}
42- REPOSITORY : " /mage"
43- IMAGE_TAG : ${{ env.IMAGE_TAG }}
4436 run : |
45- docker build -t $REGISTRY$REPOSITORY :$IMAGE_TAG .
37+ docker build -t ghcr.io/${{ github.repository }}/mage :$IMAGE_TAG .
4638
4739 - name : Push Image
48- if : github.ref =='refs/heads/test' || github.ref =='refs/heads/develop'
49- env :
50- SERVICE : " mage${{ env.IMAGE_TAG }}"
51- REGISTRY : ${{ steps.ecr-login.outputs.registry }}
52- REPOSITORY : " /mage"
53- IMAGE_TAG : ${{ env.IMAGE_TAG }}
40+ # if: github.ref =='refs/heads/test' || github.ref =='refs/heads/develop'
5441 run : |
55- docker push $REGISTRY$REPOSITORY :$IMAGE_TAG
42+ docker push ghcr.io/${{ github.repository }}/mage :$IMAGE_TAG
You can’t perform that action at this time.
0 commit comments