Merge pull request #81 from T2-Papillon/TotalSearchTest_v0.3.0/dana #98
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy2aws π | |
on: | |
push: | |
branches: | |
- dev | |
pull_request: | |
types: | |
- closed | |
jobs: | |
deploy: | |
# if: github.event.pull_request.merged == true | |
environment: dev | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# AWS μΈμ¦ (IAM μ¬μ©μ Access Key, Secret Key νμ©) | |
- 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: ${{ vars.AWS_REGION }} | |
# λΉλ κ²°κ³Όλ¬Όμ S3 λ²ν·μ μ λ‘λ | |
- name: Upload to AWS S3 | |
run: | | |
aws deploy push \ | |
--application-name ${{ vars.CODE_DEPLOY_APP_NAME }} \ | |
--s3-location s3://${{ vars.S3_BUCKET_NAME }}/$GITHUB_SHA.zip \ | |
--source . | |
# S3 λ²ν·μ μλ νμΌμ λμμΌλ‘ CodeDeploy μ€ν | |
- name: Deploy to AWS EC2 from S3 | |
run: | | |
aws deploy create-deployment \ | |
--application-name ${{ vars.CODE_DEPLOY_APP_NAME }} \ | |
--deployment-config-name CodeDeployDefault.AllAtOnce \ | |
--deployment-group-name ${{ vars.CODE_DEPLOY_DEPLOYMENT_GROUP_NAME }} \ | |
--s3-location bucket=${{ vars.S3_BUCKET_NAME }},key=$GITHUB_SHA.zip,bundleType=zip |