@@ -15,46 +15,30 @@ concurrency:
1515 cancel-in-progress : true
1616
1717jobs :
18- push_to_registry :
19- name : Build and Push Docker Image
18+ build :
2019 runs-on : ubuntu-latest
21-
22- permissions :
23- contents : read
24- packages : write
25-
2620 steps :
27- - name : Checkout repository
21+ - name : Checkout
2822 uses : actions/checkout@v4
29-
30- - name : Set up Docker Buildx
31- uses : docker/setup-buildx-action@v3
32-
33- - name : Log in to Container Registry
34- uses : docker/login-action@v3
35- with :
36- registry : ${{ env.REGISTRY }}
37- username : ${{ github.actor }}
38- password : ${{ secrets.GITHUB_TOKEN }}
39-
40- - name : Extract metadata
23+
24+ - name : Extract Docker image metadata
4125 id : meta
4226 uses : docker/metadata-action@v5
4327 with :
44- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
45- tags : |
46- type=ref,event=branch
47- type=sha,prefix=sha-
48- type=raw,value=latest,enable={{is_default_branch}}
49-
28+ images : ghcr.io/${{ github.repository_owner }}/my-image
29+
30+ - name : Login to GitHub Container Registry
31+ uses : docker/login-action@v3
32+ with :
33+ registry : ghcr.io
34+ username : ${{ github.repository_owner }}
35+ password : ${{ secrets.GITHUB_TOKEN }}
36+
37+ - name : Set up Docker Buildx
38+ uses : docker/setup-buildx-action@v3
39+
5040 - name : Build and push Docker image
5141 uses : docker/build-push-action@v6
5242 with :
53- context : .docker
54- file : .docker/app/Dockerfile
55- platforms : linux/amd64,linux/arm64
5643 push : true
5744 tags : ${{ steps.meta.outputs.tags }}
58- labels : ${{ steps.meta.outputs.labels }}
59- cache-from : type=gha
60- cache-to : type=gha,mode=max
0 commit comments