@@ -10,33 +10,35 @@ permissions: read-all
1010jobs :
1111 build-and-publish-images :
1212 runs-on : ubuntu-latest
13+ permissions :
14+ packages : write
1315 steps :
1416 - name : Checkout code
1517 uses : actions/checkout@v4
16- - name : Login to AWS Public ECR
18+ - name : Login to GitHub Container Registry
1719 uses : docker/login-action@v3
1820 with :
19- registry : public.ecr.aws
20- username : ${{ secrets.AWS_ACCESS_KEY_ID }}
21- password : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
21+ registry : ghcr.io
22+ username : ${{ github.actor }}
23+ password : ${{ secrets.GITHUB_TOKEN }}
2224 - name : Extract tag name
2325 id : extract_tag_name
2426 run : echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2527 - name : Build and push gitvote-dbmigrator image
2628 run : |
2729 docker build \
2830 -f database/migrations/Dockerfile \
29- -t public.ecr.aws/g6m3a0y9/gitvote- dbmigrator:${{steps.extract_tag_name.outputs.tag}} \
30- -t public.ecr.aws/g6m3a0y9/gitvote- dbmigrator:latest \
31+ -t ghcr.io/${{ github.repository }}/ dbmigrator:${{steps.extract_tag_name.outputs.tag}} \
32+ -t ghcr.io/${{ github.repository }}/ dbmigrator:latest \
3133 .
32- docker push --all-tags public.ecr.aws/g6m3a0y9/gitvote- dbmigrator
34+ docker push --all-tags ghcr.io/${{ github.repository }}/ dbmigrator
3335 - name : Build and push gitvote image
3436 run : |
3537 docker build \
36- -t public.ecr.aws/g6m3a0y9/gitvote :${{steps.extract_tag_name.outputs.tag}} \
37- -t public.ecr.aws/g6m3a0y9/gitvote :latest \
38+ -t ghcr.io/${{ github.repository }}/server :${{steps.extract_tag_name.outputs.tag}} \
39+ -t ghcr.io/${{ github.repository }}/server :latest \
3840 .
39- docker push --all-tags public.ecr.aws/g6m3a0y9/gitvote
41+ docker push --all-tags ghcr.io/${{ github.repository }}/server
4042
4143 package-and-publish-helm-chart :
4244 needs :
0 commit comments