File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,14 +185,17 @@ jobs:
185185 id : init
186186 run : " packer init ./images/ami/proxy.pkr.hcl"
187187
188- - name : Run `packer validate`
188+ - name : Build AMI images for multiple regions
189189 if : matrix.build == 'linux' && matrix.arch == 'amd64'
190- id : validate
191- run : packer validate --var "package_version=${{ env.VERSION }}" ./images/ami/proxy.pkr.hcl
192-
193- - name : Build AMI image
194- if : matrix.build == 'linux' && matrix.arch == 'amd64'
195- run : packer build -color=false -on-error=abort --var "package_version=${{ env.VERSION }}" ./images/ami/proxy.pkr.hcl
190+ run : |
191+ regions=(us-east-1 eu-west-1)
192+ for region in "${regions[@]}"; do
193+ echo "Building AMI for region: $region"
194+ echo "Running packer validate for $region..."
195+ packer validate --var "package_version=${{ env.VERSION }}" --var "region=$region" ./images/ami/proxy.pkr.hcl
196+ echo "Building AMI image for $region..."
197+ packer build -color=false -on-error=abort --var "package_version=${{ env.VERSION }}" --var "region=$region" ./images/ami/proxy.pkr.hcl
198+ done
196199 env :
197200 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
198201 AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
You can’t perform that action at this time.
0 commit comments