44 push :
55 branches :
66 - ' main'
7- tags :
8- - ' *'
97 pull_request :
108
119jobs :
@@ -16,15 +14,20 @@ jobs:
1614 uses : actions/checkout@v4
1715 - name : Docker meta
1816 id : docker_meta
19- uses : crazy-max/ghaction-docker-meta@v5.5.1
17+ uses : crazy-max/ghaction-docker-meta@v5.7.0
2018 with :
2119 images : ghcr.io/${{ github.repository }}
20+ tags : |
21+ type=sha
2222 - name : Set up QEMU
2323 uses : docker/setup-qemu-action@v3
2424 - name : Set up Docker Buildx
25- uses : docker/setup-buildx-action@v3.3.0
25+ uses : docker/setup-buildx-action@v3.11.1
2626 - name : Set up helmfile
27- uses : helmfile/helmfile-action@v1.9.1
27+ uses : helmfile/helmfile-action@v2.0.4
28+ with :
29+ helmfile-version : ' v0.162.0'
30+ helm-version : ' v3.12.2'
2831 - name : Cache Docker layers
2932 uses : actions/cache@v4
3033 with :
4043 username : ${{ github.repository_owner }}
4144 password : ${{ secrets.GITHUB_TOKEN }}
4245 - name : Build and push
43- uses : docker/build-push-action@v5.3 .0
46+ uses : docker/build-push-action@v6.15 .0
4447 with :
4548 context : .
4649 file : ./Dockerfile
@@ -50,37 +53,29 @@ jobs:
5053 push : ${{ github.event_name != 'pull_request' }}
5154 tags : ${{ steps.docker_meta.outputs.tags }}
5255 labels : ${{ steps.docker_meta.outputs.labels }}
53-
54- - name : Check whether wbaas-deploy should be updated
55- id : update-check
56- run : |
57- if [[ "$GITHUB_REF" =~ ^refs/tags/.+$ ]]; then
58- echo "This is a tagged release, will try to create an update in wbaas-deploy."
59- echo "match=true" >> $GITHUB_OUTPUT
60- fi
6156 - name : Check out `wmde/wbaas-deploy` repository in staging child directory
62- if : steps.update-check.outputs.match == 'true '
57+ if : github.event_name != 'pull_request '
6358 uses : actions/checkout@v4
6459 with :
6560 repository : wmde/wbaas-deploy
6661 path : ./repos/wbaas-deploy-staging
6762 - name : Check out `wmde/wbaas-deploy` repository in production child directory
68- if : steps.update-check.outputs.match == 'true '
63+ if : github.event_name != 'pull_request '
6964 uses : actions/checkout@v4
7065 with :
7166 repository : wmde/wbaas-deploy
7267 path : ./repos/wbaas-deploy-production
7368 - name : Update values for local, staging and production
74- if : steps.update-check.outputs.match == 'true '
69+ if : github.event_name != 'pull_request '
7570 id : update-values
7671 run : |
77- TAG="$GITHUB_REF_NAME "
72+ TAG="$(echo ${{ steps.docker_meta.outputs.tags }} | cut -d':' -f2) "
7873 echo "tag=$TAG" >> $GITHUB_OUTPUT
7974 sed -i "/image:/{n;s/tag:.*/tag: $TAG/;}" ./repos/wbaas-deploy-staging/k8s/helmfile/env/local/api.values.yaml.gotmpl
8075 sed -i "/image:/{n;s/tag:.*/tag: $TAG/;}" ./repos/wbaas-deploy-staging/k8s/helmfile/env/staging/api.values.yaml.gotmpl
8176 sed -i "/image:/{n;s/tag:.*/tag: $TAG/;}" ./repos/wbaas-deploy-production/k8s/helmfile/env/production/api.values.yaml.gotmpl
8277 - name : Update argo values for local, staging and production
83- if : steps.update-check.outputs.match == 'true '
78+ if : github.event_name != 'pull_request '
8479 id : update-argo-values
8580 run : |
8681 cd ./repos/wbaas-deploy-staging
@@ -92,18 +87,18 @@ jobs:
9287 cd ../wbaas-deploy-production
9388 ./bin/generate-values production api
9489 - name : Truncate commit message
95- if : steps.update-check.outputs.match == 'true '
90+ if : github.event_name != 'pull_request '
9691 id : truncate-commit-message
9792 run : |
98- MSG=$(echo "${{ github.event.head_commit.message }}" | head -n 1 )
93+ MSG=$(git log -1 --pretty=format:%s )
9994 echo "msg=$MSG" >> $GITHUB_OUTPUT
10095 - name : Create Staging+Local Pull Request
101- uses : peter-evans/create-pull-request@v6
102- if : steps.update-check.outputs.match == 'true '
96+ uses : peter-evans/create-pull-request@v7
97+ if : github.event_name != 'pull_request '
10398 with :
10499 path : ./repos/wbaas-deploy-staging
105- commit-message : ' Staging+Local: Deploy new Platform API image ${{ steps.update-values .outputs.tag }}'
106- title : ' Staging+Local: Deploy new Platform API image ${{ steps.update-values .outputs.tag }}'
100+ commit-message : ' Staging+Local: Deploy new Platform API image ${{ steps.docker_meta .outputs.tags }}'
101+ title : ' Staging+Local: Deploy new Platform API image ${{ steps.docker_meta .outputs.tags }}'
107102 branch : deploy-to-staging-${{ steps.update-values.outputs.tag }}
108103 committer : wmdebot <github-bots@wikimedia.de>
109104 author : wmdebot <github-bots@wikimedia.de>
@@ -114,12 +109,12 @@ jobs:
114109
115110 **Changes**: [${{ steps.truncate-commit-message.outputs.msg }}](https://github.com/wbstack/api/commit/${{ github.sha }})
116111 - name : Create Production Pull Request
117- uses : peter-evans/create-pull-request@v6
118- if : steps.update-check.outputs.match == 'true '
112+ uses : peter-evans/create-pull-request@v7
113+ if : github.event_name != 'pull_request '
119114 with :
120115 path : ./repos/wbaas-deploy-production
121- commit-message : ' Production: Deploy new Platform API image ${{ steps.update-values .outputs.tag }}'
122- title : ' Production: Deploy new Platform API image ${{ steps.update-values .outputs.tag }}'
116+ commit-message : ' Production: Deploy new Platform API image ${{ steps.docker_meta .outputs.tags }}'
117+ title : ' Production: Deploy new Platform API image ${{ steps.docker_meta .outputs.tags }}'
123118 branch : deploy-to-production-${{ steps.update-values.outputs.tag }}
124119 committer : wmdebot <github-bots@wikimedia.de>
125120 author : wmdebot <github-bots@wikimedia.de>
0 commit comments