@@ -123,84 +123,6 @@ jobs:
123123 build-args : |
124124 PRETIX_IMAGE=${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com/pythonit/pretix:pretix-base-${{ steps.git.outputs.githash }}
125125
126- build-and-push-service :
127- runs-on : ubuntu-latest
128- permissions :
129- packages : write
130- contents : read
131-
132- strategy :
133- fail-fast : false
134- matrix :
135- service :
136- - name : pycon-backend
137- dir : backend
138-
139- steps :
140- - uses : actions/checkout@v4
141- with :
142- ref : ${{ github.ref }}
143- fetch-depth : 0
144- - name : Configure AWS credentials
145- uses : aws-actions/configure-aws-credentials@v4
146- with :
147- aws-access-key-id : ${{ secrets.aws_access_key_id }}
148- aws-secret-access-key : ${{ secrets.aws_secret_access_key }}
149- aws-region : eu-central-1
150- - name : Get service githash
151- id : git
152- run : |
153- hash=$(git rev-list -1 HEAD -- ${{ matrix.service.dir }})
154- echo "githash=$hash" >> $GITHUB_OUTPUT
155- - name : Check if commit is already on ECR
156- id : image
157- run : |
158- set +e
159- aws ecr describe-images --repository-name=pythonit/${{ matrix.service.name }} --image-ids=imageTag=${{ steps.git.outputs.githash }}
160- if [[ $? == 0 ]]; then
161- echo "image_exists=1" >> $GITHUB_OUTPUT
162- else
163- echo "image_exists=0" >> $GITHUB_OUTPUT
164- fi
165- - name : Set up QEMU dependency
166- if : ${{ steps.image.outputs.image_exists == 0 }}
167- uses : docker/setup-qemu-action@v3
168- - name : Login to GitHub Packages
169- if : ${{ steps.image.outputs.image_exists == 0 }}
170- uses : docker/login-action@v3
171- with :
172- registry : ghcr.io
173- username : ${{ github.actor }}
174- password : ${{ secrets.GITHUB_TOKEN }}
175- - name : Login to Amazon ECR
176- if : ${{ steps.image.outputs.image_exists == 0 }}
177- uses : aws-actions/amazon-ecr-login@v2
178- - name : Set up Docker Buildx
179- id : buildx
180- if : ${{ steps.image.outputs.image_exists == 0 }}
181- uses : docker/setup-buildx-action@v3
182- - name : Cache Docker layers
183- if : ${{ steps.image.outputs.image_exists == 0 }}
184- uses : actions/cache@v4
185- with :
186- path : /tmp/.buildx-cache
187- key : ${{ runner.os }}-buildx-${{ matrix.service.name }}
188- - name : Build and push
189- if : ${{ steps.image.outputs.image_exists == 0 }}
190- uses : docker/build-push-action@v6
191- with :
192- context : ./${{ matrix.service.dir }}
193- file : ./${{ matrix.service.dir }}/Dockerfile
194- builder : ${{ steps.buildx.outputs.name }}
195- provenance : false
196- push : true
197- tags : |
198- ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com/pythonit/${{ matrix.service.name }}:${{ steps.git.outputs.githash }}
199- ghcr.io/pythonitalia/pycon/${{ matrix.service.name }}:${{ steps.git.outputs.githash }}
200- cache-from : type=local,src=/tmp/.buildx-cache
201- cache-to : type=local,dest=/tmp/.buildx-cache
202- platforms : linux/amd64
203-
204126 build-and-push-arm-service :
205127 runs-on : [self-hosted]
206128 permissions :
@@ -274,7 +196,7 @@ jobs:
274196
275197 terraform :
276198 runs-on : ubuntu-latest
277- needs : [build-and-push-service, build-and-push- arm-service, build-pretix, create-db]
199+ needs : [build-and-push-arm-service, build-pretix, create-db]
278200 environment :
279201 name : ${{ fromJSON('["pastaporto", "production"]')[github.ref == 'refs/heads/main'] }}
280202 defaults :
0 commit comments