@@ -2,56 +2,24 @@ name: Etherpad Docker Image
22
33env :
44 REGISTRY : ghcr.io
5- NAME : etherpad
5+ PROJECTNAME : etherpad
66
77on :
88 workflow_dispatch :
99 push :
10- branches : [ " main" ]
10+ branches : [' main' ]
1111 paths :
12- - ' etherpad /*'
13- - ' .github/workflows/*etherpad *'
12+ - ' ${{env.PROJECTNAME}} /*'
13+ - ' .github/workflows/*${{env.PROJECTNAME}} *'
1414 pull_request :
15- branches : [ " main" ]
15+ branches : [' main' ]
1616 paths :
17- - ' etherpad /*'
18- - ' .github/workflows/*etherpad *'
17+ - ' ${{env.PROJECTNAME}} /*'
18+ - ' .github/workflows/*${{env.PROJECTNAME}} *'
1919 schedule :
2020 - cron : ' 23 1 * * 0' # Sunday at 1:23
2121
2222jobs :
23- build-and-push-image :
24- runs-on : ubuntu-latest
25- permissions :
26- contents : read
27- packages : write
28-
29- steps :
30- - name : set release date
31- run : |
32- echo "RELEASE_DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV}
33-
34- - id : githubactor
35- uses : ASzc/change-string-case-action@v5
36- with :
37- string : ${{ github.actor }}
38- - id : step2
39- run : echo "IMAGE_NAME=ghcr.io/${{ steps.githubactor.outputs.lowercase }}/${{ env.NAME }}" >> ${GITHUB_ENV}
40-
41- - name : Checkout repository
42- uses : actions/checkout@v3
43-
44- - name : Log in to the Container registry
45- uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
46- with :
47- registry : ${{ env.REGISTRY }}
48- username : ${{ github.actor }}
49- password : ${{ secrets.GITHUB_TOKEN }}
50-
51- - name : Build and push Docker image
52- uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
53- with :
54- context : ./${{ env.NAME }}/
55- push : true
56- tags : ${{ env.IMAGE_NAME }}:${{ env.RELEASE_DATE }}, ${{ env.IMAGE_NAME }}:latest
57- labels : ${{ env.RELEASE_DATE }}, latest
23+ include :
24+ - name : Build and Push Image
25+ uses : ./.github/templates/docker-build-template.yml
0 commit comments