Skip to content

Commit

Permalink
chore:deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
codernesty committed Aug 19, 2024
1 parent 79acd40 commit c03fe2c
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,29 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # AWS Secret Access Key stored as a GitHub secret
aws-region: ${{ secrets.AWS_REGION }} # AWS Region stored as a GitHub secret

# Step 3: Deploy the combined service to AWS App Runner
- name: Deploy Fullstack App
# Step 3: Get the App Runner service ARN
- name: Get Service ARN
id: get-service-arn
run: |
# Get the App Runner service ARN
SERVICE_ARN=$(aws apprunner list-services --query "ServiceSummaryList[?ServiceName=='${{ secrets.APP_RUNNER_SERVICE_NAME }}'].ServiceArn | [0]" --output text)
# Deploy the code to the App Runner service
echo "SERVICE_ARN=$SERVICE_ARN" >> $GITHUB_ENV
if [ -z "$SERVICE_ARN" ]; then
echo "Service ARN not found. Please check the service name and try again."
exit 1
fi
# Step 4: Deploy the combined service to AWS App Runner
- name: Deploy Fullstack App
run: |
echo "Deploying to App Runner service with ARN: $SERVICE_ARN"
aws apprunner update-service \
--service-arn $SERVICE_ARN \
--source-configuration SourceCodeRepository={"RepositoryUrl": "${{ secrets.REPOSITORY_URL }}", "SourceCodeVersion": {"Type": "BRANCH", "Value": "master"}}
--source-configuration "{
\"SourceCodeRepository\": {
\"RepositoryUrl\": \"${{ secrets.REPOSITORY_URL }}\",
\"SourceCodeVersion\": {
\"Type\": \"BRANCH\",
\"Value\": \"master\"
}
}
}"

0 comments on commit c03fe2c

Please sign in to comment.