Skip to content

Commit

Permalink
wip: enable gh deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchitrk committed Dec 7, 2024
1 parent 75611f5 commit 30af087
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions .github/workflows/srv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,30 +127,31 @@ jobs:
BUCKET=${{ env.STACK_NAME }}-${{ env.STACK_ENV }}-${{ env.AWS_REGION }}-artifacts-${{ secrets.AWS_ACCOUNT_ID }}
aws s3 cp dist.zip s3://$BUCKET/${{ env.APPLICATION }}/${{ github.sha }}/
# deploy:
# name: AWS Deploy
# needs: build
# runs-on: ubuntu-latest
# environment: Dev
# permissions:
# id-token: write
# contents: read
# steps:
# - uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: ${{ secrets.IAMROLE_GITHUB }}
# role-session-name: GitHub-Action-Role
# aws-region: ${{ env.AWS_REGION }}
#
# - name: Deploy to AWS CodeDeploy
# run: |
# BUCKET="${{ env.STACK_NAME }}-${{ env.STACK_ENV }}-${{ env.AWS_REGION }}-artifacts-${{ secrets.AWS_ACCOUNT_ID }}"
# DEPLOYMENT_NAME="${{ env.STACK_NAME }}-${{ env.STACK_ENV }}"
# DEPLOYMENT_GROUP_NAME="${{ env.STACK_NAME }}-${{ env.STACK_ENV }}-deployment-group"
#
# aws deploy create-deployment \
# --application-name "${DEPLOYMENT_NAME}" \
# --deployment-group-name "${DEPLOYMENT_GROUP_NAME}" \
# --s3-location bucket=${BUCKET},key=${{ env.APPLICATION }}/${{ github.sha }}/dist.zip,bundleType=zip \
# --ignore-application-stop-failures
deploy:
name: AWS Deploy
needs: build
runs-on: ubuntu-latest
environment:
name: staging
permissions:
id-token: write
contents: read
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.IAMROLE_GITHUB }}
role-session-name: GitHub-Action-Role
aws-region: ${{ env.AWS_REGION }}

- name: Deploy to AWS CodeDeploy
run: |
BUCKET="${{ env.STACK_NAME }}-${{ env.STACK_ENV }}-${{ env.AWS_REGION }}-artifacts-${{ secrets.AWS_ACCOUNT_ID }}"
DEPLOYMENT_NAME="${{ env.STACK_NAME }}-${{ env.STACK_ENV }}"
DEPLOYMENT_GROUP_NAME="${{ env.STACK_NAME }}-${{ env.STACK_ENV }}-deployment-group"
aws deploy create-deployment \
--application-name "${DEPLOYMENT_NAME}" \
--deployment-group-name "${DEPLOYMENT_GROUP_NAME}" \
--s3-location bucket=${BUCKET},key=${{ env.APPLICATION }}/${{ github.sha }}/dist.zip,bundleType=zip \
--ignore-application-stop-failures

0 comments on commit 30af087

Please sign in to comment.