-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 1.1 KB
/
cicd.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
30
31
32
33
34
35
36
37
38
name: CI/CD Pipeline
on:
push:
branches:
- main
- feat/#37
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: envs
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: Upload to AWS S3
run: |
aws deploy push \
--application-name ${{ vars.CODE_DEPLOY_APPLICATION_NAME }} \
--ignore-hidden-files \
--s3-location s3://${{ vars.S3_BUCKET_NAME }}/$GITHUB_SHA.zip \
--source .
- name: Deploy to AWS CodeDeploy
run: |
aws deploy create-deployment \
--application-name ${{ vars.CODE_DEPLOY_APPLICATION_NAME }} \
--deployment-group-name ${{ vars.CODE_DEPLOY_DEPLOYMENT_GROUP_NAME }} \
--s3-location bucket=${{ vars.S3_BUCKET_NAME }},key=$GITHUB_SHA.zip,bundleType=zip