55 tags :
66 - ' v*.*.*'
77
8- env :
9- REGISTRY : ghcr.io
10- IMAGE_NAME : ${{ github.repository }}
11-
128jobs :
139 deployment :
1410 name : Deployment
1511 runs-on : ubuntu-latest
16- permissions :
17- contents : read
18- packages : write
19- attestations : write
20- id-token : write
2112 environment : production
2213 steps :
23- - name : Checkout repository
24- uses : actions/checkout@v4
25-
26- - name : Log in to the Container registry
27- uses : docker/login-action@v3
28- with :
29- registry : ${{ env.REGISTRY }}
30- username : ${{ github.actor }}
31- password : ${{ secrets.GITHUB_TOKEN }}
32-
33- - name : Extract metadata (tags, labels) for Docker
14+ - name : Docker meta
3415 id : meta
3516 uses : docker/metadata-action@v5
3617 with :
37- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
18+ # list of Docker images to use as base name for tags
19+ images : |
20+ appsinet/php_development
21+ # generate Docker tags based on the following events/attributes
22+ tags : |
23+ type=schedule,pattern={{date 'YYYYMMDD'}}
24+ type=ref,event=tag
25+ type=semver,pattern={{version}}
26+ type=semver,pattern={{major}}.{{minor}}
27+ type=semver,pattern={{major}}
28+ type=sha
3829
39- - name : Build and push Docker image
40- id : push
41- uses : docker/build-push-action@v5
30+ - name : Set up Docker Buildx
31+ uses : docker/setup-buildx-action@v3
32+
33+ - name : Login to DockerHub
34+ uses : docker/login-action@v3
4235 with :
43- context : .
44- push : true
45- tags : ${{ steps.meta.outputs.tags }}
46- labels : ${{ steps.meta.outputs.labels }}
36+ username : ${{ secrets.DOCKERHUB_USERNAME }}
37+ password : ${{ secrets.DOCKERHUB_TOKEN }}
4738
48- - name : Generate artifact attestation
49- uses : actions/attest- build-provenance@v2
39+ - name : Build and push
40+ uses : docker/ build-push-action@v5
5041 with :
51- subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
52- subject-digest : ${{ steps.push.outputs.digest }}
53- push-to-registry : true
42+ push : ${{ github.event_name != 'pull_request' }}
43+ tags : ${{ steps.meta.outputs.tags }}
0 commit comments