5454 cache-to : type=local,mode=max,dest=/tmp/.buildx-cache
5555 push : ${{ github.event_name != 'pull_request' }}
5656 tags : ${{ steps.docker_meta.outputs.tags }}
57- labels : ${{ steps.docker_meta.outputs.labels }}
57+ labels : ${{ steps.docker_meta.outputs.labels }}
58+
59+ -
60+ name : Check whether wbaas-deploy should be updated
61+ id : update-check
62+ run : |
63+ if [[ "$GITHUB_REF" =~ ^refs/tags/.+$ ]]; then
64+ echo "This is a tagged release, will try to create an update in wbaas-deploy."
65+ echo "match=true" >> $GITHUB_OUTPUT
66+ fi
67+ -
68+ name : Check out `wmde/wbaas-deploy` repository in staging child directory
69+ if : steps.update-check.outputs.match == 'true'
70+ uses : actions/checkout@v3.3.0
71+ with :
72+ repository : wmde/wbaas-deploy
73+ path : ./repos/wbaas-deploy-staging
74+ -
75+ name : Check out `wmde/wbaas-deploy` repository in production child directory
76+ if : steps.update-check.outputs.match == 'true'
77+ uses : actions/checkout@v3.3.0
78+ with :
79+ repository : wmde/wbaas-deploy
80+ path : ./repos/wbaas-deploy-production
81+ -
82+ name : Update values for local, staging and production
83+ if : steps.update-check.outputs.match == 'true'
84+ id : update-values
85+ run : |
86+ TAG="$(echo ${{ steps.docker_meta.outputs.tags }} | cut -d':' -f2)"
87+ echo "tag=$TAG" >> $GITHUB_OUTPUT
88+ sed -i "/image:/{n;s/tag:.*/tag: $TAG/;}" ./repos/wbaas-deploy-staging/k8s/helmfile/env/local/api.values.yaml.gotmpl
89+ sed -i "/image:/{n;s/tag:.*/tag: $TAG/;}" ./repos/wbaas-deploy-staging/k8s/helmfile/env/staging/api.values.yaml.gotmpl
90+ sed -i "/image:/{n;s/tag:.*/tag: $TAG/;}" ./repos/wbaas-deploy-production/k8s/helmfile/env/production/api.values.yaml.gotmpl
91+ -
92+ name : Truncate commit message
93+ if : steps.update-check.outputs.match == 'true'
94+ id : truncate-commit-message
95+ run : |
96+ MSG=$(echo "${{ github.event.head_commit.message }}" | head -n 1)
97+ echo "msg=$MSG" >> $GITHUB_OUTPUT
98+ -
99+ uses : peter-evans/create-pull-request@v4
100+ if : steps.update-check.outputs.match == 'true'
101+ with :
102+ path : ./repos/wbaas-deploy-staging
103+ commit-message : ' Staging+Local: Deploy new Platform API image ${{ steps.docker_meta.outputs.tags }}'
104+ title : ' Staging+Local: Deploy new Platform API image ${{ steps.docker_meta.outputs.tags }}'
105+ branch : deploy-to-staging-${{ steps.update-values.outputs.tag }}
106+ committer : wmdebot <github-bots@wikimedia.de>
107+ author : ${{ github.actor }} <github-bots@wikimedia.de>
108+ labels : automated pr
109+ token : ${{ secrets.WBAAS_DEPLOY_TOKEN }}
110+ body : |
111+ This is an automated update for the `api` image in staging and local, using `${{ steps.update-values.outputs.tag }}`.
112+
113+ **Changes**: [${{ steps.truncate-commit-message.outputs.msg }}](https://github.com/wbstack/api/commit/${{ github.sha }})
114+ -
115+ uses : peter-evans/create-pull-request@v4
116+ if : steps.update-check.outputs.match == 'true'
117+ with :
118+ path : ./repos/wbaas-deploy-production
119+ commit-message : ' Production: Deploy new Platform API image ${{ steps.docker_meta.outputs.tags }}'
120+ title : ' Production: Deploy new Platform API image ${{ steps.docker_meta.outputs.tags }}'
121+ branch : deploy-to-production-${{ steps.update-values.outputs.tag }}
122+ committer : wmdebot <github-bots@wikimedia.de>
123+ author : ${{ github.actor }} <github-bots@wikimedia.de>
124+ labels : automated pr
125+ token : ${{ secrets.WBAAS_DEPLOY_TOKEN }}
126+ body : |
127+ This is an automated update for the `api` image in production, using `${{ steps.update-values.outputs.tag }}`.
128+
129+ **Changes**: [${{ steps.truncate-commit-message.outputs.msg }}](https://github.com/wbstack/api/commit/${{ github.sha }})
0 commit comments