@@ -45,13 +45,38 @@ jobs:
4545 echo "image_exists=0" >> $GITHUB_OUTPUT
4646 fi
4747
48- build-pretix :
49- needs : [check-pretix-build]
50- uses : ./.github/workflows/build-pretix.yml
51- with :
52- githash : ${{ needs.check-pretix-build.outputs.githash }}
53- secrets : inherit
54- if : ${{ needs.check-pretix-build.outputs.image_exists == 0 }}
48+ check-frontend-build :
49+ name : Check frontend needs building
50+ runs-on : ubuntu-24.04
51+ outputs :
52+ image_exists : ${{ steps.image.outputs.image_exists }}
53+ githash : ${{ steps.git.outputs.githash }}
54+ steps :
55+ - uses : actions/checkout@v4
56+ with :
57+ ref : ${{ github.ref }}
58+ fetch-depth : 0
59+ - name : Configure AWS credentials
60+ uses : aws-actions/configure-aws-credentials@v4
61+ with :
62+ aws-access-key-id : ${{ secrets.aws_access_key_id }}
63+ aws-secret-access-key : ${{ secrets.aws_secret_access_key }}
64+ aws-region : eu-central-1
65+ - name : Get service githash
66+ id : git
67+ run : |
68+ hash=$(git rev-list -1 HEAD -- frontend)
69+ echo "githash=$hash" >> $GITHUB_OUTPUT
70+ - name : Check if commit is already on ECR
71+ id : image
72+ run : |
73+ set +e
74+ aws ecr describe-images --repository-name=pythonit/${{ fromJSON('["pastaporto", "production"]')[github.ref == 'refs/heads/main'] }}-pycon-frontend --image-ids=imageTag=${{ steps.git.outputs.githash }}
75+ if [[ $? == 0 ]]; then
76+ echo "image_exists=1" >> $GITHUB_OUTPUT
77+ else
78+ echo "image_exists=0" >> $GITHUB_OUTPUT
79+ fi
5580
5681 check-backend-build :
5782 name : Check backend needs building
@@ -86,6 +111,14 @@ jobs:
86111 echo "image_exists=0" >> $GITHUB_OUTPUT
87112 fi
88113
114+ build-pretix :
115+ needs : [check-pretix-build]
116+ uses : ./.github/workflows/build-pretix.yml
117+ with :
118+ githash : ${{ needs.check-pretix-build.outputs.githash }}
119+ secrets : inherit
120+ if : ${{ needs.check-pretix-build.outputs.image_exists == 0 }}
121+
89122 build-be :
90123 needs : [check-backend-build]
91124 uses : ./.github/workflows/build-backend.yml
@@ -122,7 +155,7 @@ jobs:
122155 id : validate
123156 run : terraform validate -no-color
124157 - name : Terraform apply
125- run : terraform apply -target module.pretix -target module.pycon_backend -target module.clamav -target module.database -target module.emails -target module.cluster -no-color -auto-approve &> /dev/null
158+ run : terraform apply -target module.pretix -target module.pycon_backend -target module.clamav -target module.database -target module.emails -target module.cluster -target module.vpc - no-color -auto-approve &> /dev/null
126159 env :
127160 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
128161 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -132,7 +165,7 @@ jobs:
132165 wait-be-update :
133166 name : Wait backend deployment
134167 runs-on : ubuntu-24.04
135- needs : [deploy-be, build-be, check-backend-build]
168+ needs : [deploy-be, check-backend-build]
136169 steps :
137170 - uses : actions/checkout@v4
138171 with :
@@ -144,39 +177,6 @@ jobs:
144177 url : https://${{ fromJSON('["pastaporto-", ""]')[github.ref == 'refs/heads/main'] }}admin.pycon.it/health/
145178 githash : ${{ needs.check-backend-build.outputs.githash }}
146179
147- check-frontend-build :
148- name : Check frontend needs building
149- runs-on : ubuntu-24.04
150- outputs :
151- image_exists : ${{ steps.image.outputs.image_exists }}
152- githash : ${{ steps.git.outputs.githash }}
153- steps :
154- - uses : actions/checkout@v4
155- with :
156- ref : ${{ github.ref }}
157- fetch-depth : 0
158- - name : Configure AWS credentials
159- uses : aws-actions/configure-aws-credentials@v4
160- with :
161- aws-access-key-id : ${{ secrets.aws_access_key_id }}
162- aws-secret-access-key : ${{ secrets.aws_secret_access_key }}
163- aws-region : eu-central-1
164- - name : Get service githash
165- id : git
166- run : |
167- hash=$(git rev-list -1 HEAD -- frontend)
168- echo "githash=$hash" >> $GITHUB_OUTPUT
169- - name : Check if commit is already on ECR
170- id : image
171- run : |
172- set +e
173- aws ecr describe-images --repository-name=pythonit/${{ fromJSON('["pastaporto", "production"]')[github.ref == 'refs/heads/main'] }}-pycon-frontend --image-ids=imageTag=${{ steps.git.outputs.githash }}
174- if [[ $? == 0 ]]; then
175- echo "image_exists=1" >> $GITHUB_OUTPUT
176- else
177- echo "image_exists=0" >> $GITHUB_OUTPUT
178- fi
179-
180180 build-fe :
181181 needs : [wait-be-update, check-frontend-build]
182182 uses : ./.github/workflows/build-frontend.yml
0 commit comments