-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (27 loc) · 1.22 KB
/
cd-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: CD Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- 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: us-east-2
- name: Deploy application
id: deployApplicaiton
run: |
deploymentId=$(aws deploy create-deployment \
--application-name PiggyWallet-backend \
--deployment-config-name CodeDeployDefault.OneAtATime \
--deployment-group-name CodeDeployGitHubDemo-DepGrp \
--description "Automatic deployment of ${{github.sha}}" \
--github-location repository=Kalgoc/piggy-wallet-backend,commitId=${{github.sha}} | jq -r '.deploymentId')
echo "deploymentId=$deploymentId" >> $GITHUB_OUTPUT
- name: Wait for deployment to finish
run: aws deploy wait deployment-successful --deployment-id ${{ steps.deployApplicaiton.outputs.deploymentId }}