Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
24f1fc2
Updating to add a logger for publishing
Poss111 Nov 14, 2023
0da4d3c
Adding in deployment to dev as part of PR
Poss111 Nov 14, 2023
88cf1cf
Dyanmically passing workspace name to use
Poss111 Nov 14, 2023
24287fb
Removing terraform backend block
Poss111 Nov 14, 2023
913ecec
Setting up state migration
Poss111 Nov 14, 2023
9a915c0
Fixing org name
Poss111 Nov 14, 2023
2eb8133
Merge branch 'main' into eventPublisher
Poss111 Nov 14, 2023
2301126
Merge branch 'main' into eventPublisher
Poss111 Nov 14, 2023
1eb499f
Updating to use pull-request.yml as dev deployment
Poss111 Nov 14, 2023
ad9a527
Fixing pull request permissions
Poss111 Nov 14, 2023
906feb5
Updating pull request to perform build and deploy as two separate steps
Poss111 Nov 14, 2023
3d69193
Updating packaging to optimize dist
Poss111 Nov 14, 2023
1ae95a4
Fixing artifact suffix
Poss111 Nov 14, 2023
104ea33
Fixing path to artifacts
Poss111 Nov 14, 2023
0ecbcf1
Moving iac back to be deployed
Poss111 Nov 14, 2023
a256715
Adding in workspace select
Poss111 Nov 14, 2023
cdccede
Fixing output
Poss111 Nov 14, 2023
d11fd39
Updating to include a direct path for apigateway
Poss111 Nov 14, 2023
bdde9f9
Swapping up the way the backend configuration is provided
Poss111 Nov 14, 2023
fe40807
Attempting to appropriately dynamically attach a remote backend for t…
Poss111 Nov 14, 2023
495360e
Replacing workflow iac
Poss111 Nov 14, 2023
ce8fadf
Swapping to use queue url instead of queue arn
Poss111 Nov 14, 2023
a41d787
Adding in policy to publish to sqs
Poss111 Nov 14, 2023
1eba6a5
Adding MessageGroupid to event-publisher
Poss111 Nov 14, 2023
75a990d
Adding deduplication id
Poss111 Nov 14, 2023
707c30d
Setting up throttling as well as updating handler to invoke state mac…
Poss111 Nov 14, 2023
b737a90
Adding appropriate permission to start state function
Poss111 Nov 14, 2023
cd66ceb
Adding in create team lambda for step function to leverage
Poss111 Nov 17, 2023
d75d7c3
Adding a check for the json payload and fixing depedency in deployment
Poss111 Nov 17, 2023
dc6a4bb
Fixing working directory
Poss111 Nov 17, 2023
3ef0696
Fixing typo
Poss111 Nov 17, 2023
56fc30d
Fixing reference to create team lambda
Poss111 Nov 17, 2023
9a74e79
Adding in retrieve teams and refactoring workflow
Poss111 Nov 17, 2023
3a2da2a
Merge branch 'main' into eventPublisher
Poss111 Nov 17, 2023
ac8c966
Removing version for build and deploy lambda workflow
Poss111 Nov 17, 2023
9817a62
Concluding merge from main
Poss111 Nov 17, 2023
132f2fe
Concluding merge
Poss111 Nov 17, 2023
2159699
Hopefully fixing input of reusable workflow
Poss111 Nov 17, 2023
89d4deb
Fixing again...
Poss111 Nov 17, 2023
a32617d
Fixing path to functions
Poss111 Nov 17, 2023
503ff80
Merge remote-tracking branch 'origin' into eventPublisher
Poss111 Nov 17, 2023
7143245
Updating reusable lambda build
Poss111 Nov 17, 2023
9293b2d
Fixing parameterized artifact name
Poss111 Nov 17, 2023
0f6da7d
Formatting terraform code
Poss111 Nov 17, 2023
ec4fa81
Fixing step function definition
Poss111 Nov 17, 2023
43eb7e0
Adding variables
Poss111 Nov 17, 2023
fd3db24
Fixing artifact path
Poss111 Nov 17, 2023
8bed3e9
Creating lambda module
Poss111 Nov 17, 2023
e71adad
Formatting
Poss111 Nov 17, 2023
7f4b7ba
Fixing step functions
Poss111 Nov 17, 2023
fa83ca9
Hoping this is the last update
Poss111 Nov 17, 2023
8dc959f
Fixing output.tf
Poss111 Nov 18, 2023
6e734ea
Fixing arn used in lambda gateway
Poss111 Nov 18, 2023
b77ed7c
Testing out caching of node modules
Poss111 Nov 18, 2023
3ca8021
Triggering another build
Poss111 Nov 18, 2023
d6a44ee
Testing out caching of lambda artifacts
Poss111 Nov 18, 2023
8613514
Pushing out new version of all artifacts
Poss111 Nov 18, 2023
ac88c3e
Adding in custom script for retrieving latest artifact version
Poss111 Nov 18, 2023
001155a
Fixing script path
Poss111 Nov 18, 2023
b03cdc5
Fixing script name
Poss111 Nov 18, 2023
c6c7d76
Removing incorrect profile
Poss111 Nov 18, 2023
78bc6d6
Fixing arguement order
Poss111 Nov 18, 2023
1f73287
Adding terraform apply back in and adding in versions used to PR comment
Poss111 Nov 18, 2023
9395c75
Updating state machine to use is eligible function
Poss111 Nov 18, 2023
256101a
Adding link back to event handler
Poss111 Nov 18, 2023
2297c88
Adding in appropriate permission for lambda functions to be invoked b…
Poss111 Nov 18, 2023
8be7b6c
Swapping to use the lambda
Poss111 Nov 18, 2023
1e36379
Adding appropriate permissions for step function
Poss111 Nov 18, 2023
5a2cd8a
Updating to parsing
Poss111 Nov 18, 2023
eef95df
Swapping output path
Poss111 Nov 18, 2023
67272f6
Updating to json payload for is eligible lambda
Poss111 Nov 18, 2023
cb39ff7
Adding addtional logging
Poss111 Nov 18, 2023
6979b1f
Adding in hash to restore key
Poss111 Nov 18, 2023
f3fcf01
Moving build and install before cache
Poss111 Nov 18, 2023
86fc80c
Will this work?
Poss111 Nov 18, 2023
a38ef9e
Adding zip
Poss111 Nov 18, 2023
5b560dd
Making lambda aritifact in github actions generic
Poss111 Nov 18, 2023
06c4be3
Triggering build
Poss111 Nov 18, 2023
9419d0d
Will this work?
Poss111 Nov 18, 2023
2bbcba6
Triggering build
Poss111 Nov 18, 2023
ce848f8
Testing out caching
Poss111 Nov 18, 2023
5e38609
Adding working directory
Poss111 Nov 18, 2023
4d5bf15
Generating hash with shell
Poss111 Nov 18, 2023
1730220
Update build_and_deploy_lambda.yml
Poss111 Nov 18, 2023
2a93c65
Update build_and_deploy_lambda.yml
Poss111 Nov 18, 2023
94cabdf
Update build_and_deploy_lambda.yml
Poss111 Nov 18, 2023
a81ade7
Update build_and_deploy_lambda.yml
Poss111 Nov 18, 2023
c7a44f6
Update handler.ts
Poss111 Nov 18, 2023
739817b
Update build_and_deploy_lambda.yml
Poss111 Nov 18, 2023
95b490e
Update build_and_deploy_lambda.yml
Poss111 Nov 18, 2023
caf6a56
Update handler.ts
Poss111 Nov 18, 2023
a333ecc
Adding in event notifier lambda
Poss111 Nov 19, 2023
58c2bca
Adding in stage deployment for websocket
Poss111 Nov 19, 2023
fa15f70
Adding disconnect and message routes
Poss111 Nov 19, 2023
1eeaa11
Adding a subscribe route
Poss111 Nov 19, 2023
dc400b1
Removing deployment-id
Poss111 Nov 19, 2023
ff63d3d
Formatting
Poss111 Nov 19, 2023
38e25f6
Adding in default route
Poss111 Nov 19, 2023
7009eb7
Swapping to subscribe route
Poss111 Nov 19, 2023
3a5429f
Adding in subscribe and unsubscribe functionality
Poss111 Nov 19, 2023
d7a02f0
Removing range key
Poss111 Nov 19, 2023
a5d3837
Fixing schema
Poss111 Nov 19, 2023
7621cac
Setting up appropriately table to be invoked for notifier
Poss111 Nov 19, 2023
a8a49c0
Adding websocket publisher lambda
Poss111 Nov 25, 2023
bf9575b
Adding websocket publisher to built artifacts
Poss111 Nov 25, 2023
9f7e45b
Updating to include WATCH_ALL subscription type to the ws api gateway
Poss111 Dec 5, 2023
e34ff7f
Adding service integration for websocket publisher
Poss111 Dec 5, 2023
64dbf4d
Resolving typo
Poss111 Dec 5, 2023
fb8cabe
Swapping to use table name instead
Poss111 Dec 5, 2023
3f4f38b
Building the callback url for the ws dynamically
Poss111 Dec 5, 2023
483e430
Adding policy to allow invocation of api gateway
Poss111 Dec 5, 2023
88f7d5b
Setting a rate limit and adding correct permissions
Poss111 Dec 5, 2023
5142ab2
Adding manage connections permission
Poss111 Dec 5, 2023
c1c73f4
Updating is eligible to use correct Tournament key and updating to us…
Poss111 Dec 8, 2023
31aac44
Fixing no WATCH_ALL mode issue with publisher
Poss111 Dec 11, 2023
cfb907e
Swapping to use PAY_PER_REQUEST instead of PROVISIONED
Poss111 Dec 20, 2023
ab8fc7e
Removing node_modules to be uploaded for each lambda
Poss111 Mar 13, 2024
7181c83
Fixing data resource
Poss111 Mar 13, 2024
1a859ff
Fixing data name
Poss111 Mar 13, 2024
3a214e6
Fixing data block name
Poss111 Mar 13, 2024
6cb93e9
Fixing pay per request issue
Poss111 Mar 13, 2024
4980be6
Fixing format
Poss111 Mar 13, 2024
791ce07
Fixing one of the lambda layer arns
Poss111 Mar 13, 2024
859dcc7
Fixing fixing fixing
Poss111 Mar 13, 2024
fa07d1b
Updating lambda layer version
Poss111 Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 38 additions & 12 deletions .github/workflows/build_and_deploy_lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,64 @@ jobs:
permissions:
id-token: write
contents: read

steps:
- uses: FranzDiebold/github-env-vars-action@v2.1.0

- name: Checkout
uses: actions/checkout@v2

- name: Generate hash
id: generate-hash
run: |
ls -lha
echo "::set-output name=hash::$(find src/* package.json -type f -exec sha256sum {} \; | sha256sum)"

- name: Cache lambda artifact
id: cache
uses: actions/cache@v2
with:
path: ${{ inputs.working-directory}}/lambda-artifact.zip
key: ${{ inputs.artifact-name }}-lambda-${{ steps.generate-hash.outputs.hash }}
restore-keys: |
${{ inputs.artifact-name }}-lambda-

- name: Setup Node.js
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Checkout
uses: actions/checkout@v2
- name: Cache Node.js modules
uses: actions/cache@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install

- name: Build Artifact
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm run build
zip -r ./lambda-artifact.zip ./prod ./package.json

- name: Test
if: steps.cache.outputs.cache-hit != 'true'
run: npm test

- name: Configure AWS Credentials
if: steps.cache.outputs.cache-hit != 'true'
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::816923827429:role/ClashBotGitHubUser
aws-region: ${{ inputs.region }}

- name: Archive and Publish
if: steps.cache.outputs.cache-hit != 'true'
run: |
zip -r ./${{ inputs.artifact-name}}.zip ./prod ./node_modules ./package.json
aws s3 cp ./event-publisher.zip s3://${{ inputs.s3-bucket-name }}/artifacts/$(echo ${{ inputs.environment-name }} | awk '{print tolower($0)}')/${{ github.run_number }}/${{ inputs.artifact-name}}.zip

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: event-publisher-${{ inputs.environment-name }}-${{ github.run_number }}
path: ${{ inputs.working-directory}}/${{ inputs.artifact-name }}.zip
if-no-files-found: error
aws s3 cp ./lambda-artifact.zip s3://${{ inputs.s3-bucket-name }}/artifacts/${{ inputs.artifact-name}}/$(echo ${{ inputs.environment-name }} | awk '{print tolower($0)}')/artifact-${{ github.run_number }}.zip
Loading