-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy to lambdas from cdk #111
base: master
Are you sure you want to change the base?
Changes from 70 commits
ae78469
277bf7d
c56fbf9
b07e262
2a7c157
5e97e76
44ac61e
aff4c1e
1550043
2dc172f
a96c88b
e0b50fb
ad023d5
4e3c907
9ddee9e
19a2867
1634b6c
ee95562
8af122f
b30215d
93e8514
54f7897
488a7bf
4a1a2f8
5087d1f
2965223
7fe6af4
090afa5
7e9c01f
475c035
6cb9db9
9ea6dbb
5e48c7d
2997865
676e5de
d452d78
634ca83
51e4f9c
366af61
5255cdd
5692cf0
24ac75d
6fc0b8b
4353f06
7ed1eb0
392161f
2ad4fa6
dac1964
556f5cd
8e82f12
98b99d0
ccd2730
1aad9da
fe3fffa
63e8e6a
76a06a1
a60adf4
515d589
f44187f
a8a8c26
7ff5d08
2a49e5c
1c072bc
771bbbc
26786bc
2b0df14
dad85d7
1a83716
5bbd675
a9e74b8
351dec6
268715b
9bd1825
510f7cc
14d1277
f239f84
363533a
d09a293
95d401f
9a43eb8
c7dba84
24db49a
bb8d666
5897325
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Deploy to AWS | ||
|
||
on: | ||
pull_request: # for now, trigger this on PR so I can test it before merging | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
AWS_REGION: us-east-2 | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
dockerimage: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need this? We're not using a docker image, right? |
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Check out code | ||
|
||
- uses: docker/build-push-action@v1 | ||
name: Build and Push Docker image | ||
with: | ||
repository: joshprzybyszewski/cribbage | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
tag_with_ref: true | ||
add_git_labels: true | ||
tag_with_sha: false | ||
cache_froms: joshprzybyszewski/cribbage:master | ||
|
||
deploy: | ||
needs: dockerimage | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ env.AWS_REGION }} | ||
|
||
- name: Install CDK and Stack Dependencies | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Maybe in a future improvement, we could split our frontend/backend CDK stacks and conditionally deploy them in our github actions based on the files touched in a given PR |
||
run: | | ||
sudo npm i -g aws-cdk | ||
cd infrastructure | ||
npm install | ||
|
||
- name: Synth CDK | ||
run: | | ||
cd infrastructure | ||
cdk synth | ||
env: | ||
AWS_REGION: ${{ env.AWS_REGION }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
- name: Deploy CDK | ||
run: | | ||
cd infrastructure | ||
cdk deploy --require-approval never "*" | ||
if: github.ref == 'refs/heads/master' | ||
env: | ||
AWS_REGION: ${{ secrets.AWS_REGION }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:badpokerface: