@@ -157,46 +157,40 @@ jobs:
157157 needs : react-check
158158 deploy :
159159 runs-on : ubuntu-latest
160- container :
161- image : pennlabs/helm-tools:39b60af248944898fcbc58d1fe5b0f1995420aef
162160 if : github.ref == 'refs/heads/master'
163161 steps :
164162 - uses : actions/checkout@v2
165- - name : Deploy
163+ - id : synth
164+ name : Synth cdk8s manifests
166165 run : |-
167- aws eks --region us-east-1 update-kubeconfig --name production --role-arn arn:aws:iam::${AWS_ACCOUNT_ID}:role/kubectl
166+ cd k8s
167+ yarn install --frozen-lockfile
168168
169169 # get repo name (by removing owner/organization)
170- RELEASE_NAME=${REPOSITORY#*/}
170+ export RELEASE_NAME=${REPOSITORY#*/}
171+
172+ # Export RELEASE_NAME as an output
173+ echo "::set-output name=RELEASE_NAME::$RELEASE_NAME"
171174
172- # this specifies what tag of icarus to pull down
173- DEPLOY_TAG=$(yq r k8s/values.yaml deploy_version)
174- if [ "$DEPLOY_TAG" = "null" ]; then
175- echo "Could not find deploy tag"
176- exit 1
177- fi
175+ yarn build
176+ env :
177+ GIT_SHA : ${{ github.sha }}
178+ REPOSITORY : ${{ github.repository }}
179+ AWS_ACCOUNT_ID : ${{ secrets.AWS_ACCOUNT_ID }}
180+ - name : Deploy
181+ run : |-
182+ aws eks --region us-east-1 update-kubeconfig --name production --role-arn arn:aws:iam::${AWS_ACCOUNT_ID}:role/kubectl
178183
179- helm repo add pennlabs https://helm.pennlabs.org/
180- for i in {1..10}; do
181- # This is bash soup, but it'll do.
182- # 1. Attempt to install with helm
183- # 2. If this succeeds, exit with a success status code
184- # 3. If it fails, mark the command as succeeded so that '-e' doesn't kick us out
185- # 4. Wait 10s and try again
186- helm upgrade --install --atomic --set=image_tag=$IMAGE_TAG -f k8s/values.yaml --version "${DEPLOY_TAG}" $RELEASE_NAME pennlabs/icarus && exit 0 || true
187- sleep 10s
188- echo "Retrying deploy for $i times"
189- done
184+ # get repo name from synth step
185+ RELEASE_NAME=${{ steps.synth.outputs.RELEASE_NAME }}
190186
191- # If we get here, all helm installs failed so our command should fail
192- exit 1
187+ # Deploy
188+ kubectl apply -f k8s/dist/ -l app.kubernetes.io/component=certificate
189+ kubectl apply -f k8s/dist/ --prune -l app.kubernetes.io/part-of=$RELEASE_NAME
193190 env :
194- IMAGE_TAG : ${{ github.sha }}
195191 AWS_ACCOUNT_ID : ${{ secrets.AWS_ACCOUNT_ID }}
196192 AWS_ACCESS_KEY_ID : ${{ secrets.GH_AWS_ACCESS_KEY_ID }}
197193 AWS_SECRET_ACCESS_KEY : ${{ secrets.GH_AWS_SECRET_ACCESS_KEY }}
198- DO_AUTH_TOKEN : ${{ secrets.DO_AUTH_TOKEN }}
199- REPOSITORY : ${{ github.repository }}
200194 needs :
201195 - publish-backend
202196 - publish-frontend
0 commit comments