File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ jobs:
1717 - name : Checkout Code
1818 uses : actions/checkout@v4
1919
20- - name : Setup Node.js
21- uses : actions/setup-node@v4
22- with :
23- node-version : ' 20 '
20+ - name : Get Commit Hash (GITHUB_SHA)
21+ id : commit_hash
22+ run : |
23+ echo "COMMIT_HASH=$GITHUB_SHA" >> $GITHUB_ENV
2424
2525 - name : Install Dependencies
2626 run : |
4242
4343 - name : Upload Build to S3
4444 run : |
45- COMMIT_HASH=$(git rev-parse --short HEAD)
4645 cd application
4746 zip -r build.zip appspec.yml build/ scripts/
48- aws s3 cp build.zip s3://${{ secrets.S3_BUCKET }}/builds/build-$COMMIT_HASH.zip
49-
50- - name : Debug S3 Key
51- run : |
52- echo "S3 Key: builds/build-$COMMIT_HASH.zip"
47+ aws s3 cp build.zip s3://${{ secrets.S3_BUCKET }}/builds/build-$GITHUB_SHA.zip
5348
5449 deploy :
5550 runs-on : ubuntu-latest
6560
6661 - name : Deploy to CodeDeploy
6762 run : |
68- echo "S3 Key: builds/build-$COMMIT_HASH.zip "
63+ echo "Using Commit Hash: $GITHUB_SHA "
6964 aws deploy create-deployment \
7065 --application-name CodeDeployAppNameWithASG \
7166 --deployment-group-name CodeDeployGroupName \
72- --s3-location bucket=${{ secrets.S3_BUCKET }},key=builds/build-$COMMIT_HASH .zip,bundleType=zip
67+ --s3-location bucket=${{ secrets.S3_BUCKET }},key=builds/build-$GITHUB_SHA .zip,bundleType=zip
You can’t perform that action at this time.
0 commit comments