77
88env :
99 EB_ENV_NAME : code-challenge-stage
10- S3_BUCKET : hackcwhq.com
1110
1211jobs :
1312 deploy :
@@ -16,35 +15,38 @@ jobs:
1615 runs-on : ubuntu-latest
1716
1817 steps :
19- - uses : actions/checkout@v1
20- - uses : actions/setup-python@v1
21- with :
22- python-version : ' 3.6'
23- architecture : ' x64'
24- - uses : actions/setup-node@v1
25- with :
26- node-version : ' 12.13.1'
27- - name : Install npm and yarn
28- run : |
29- npm install -g yarn
30- yarn install
31- - name : Build Vue with yarn
32- run : yarn build
33- - name : Install AWSCLI and AWSEBCLI
34- run : |
35- python -m pip install --upgrade pip
36- pip install awscli --upgrade
37- pip install awsebcli --upgrade
38- - name : Create ElasticBeanstalk configuration folder
39- run : mkdir .elasticbeanstalk
40- - name : Write AWS EB config from Secrets
41- run : printf "%s" "${{ secrets.EB_CONFIG }}" > .elasticbeanstalk/config.yml
42- - name : Write AWS credentials from Secrets
43- run : |
44- mkdir ~/.aws/
45- echo -e "[default]\naws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}\naws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" > ~/.aws/credentials
46- echo -e "[default]\nregion=${{ secrets.AWS_DEFAULT_REGION }}\noutput=json" > ~/.aws/config
47- - name : Deploy
48- run : eb deploy ${{ env.EB_ENV_NAME }}
49- - name : Deploy frontend to S3
50- run : aws s3 sync dist/ s3://${{ env.S3_BUCKET }}
18+ - uses : actions/checkout@v1
19+ - uses : actions/setup-python@v1
20+ with :
21+ python-version : ' 3.6'
22+ architecture : ' x64'
23+ - uses : actions/setup-node@v1
24+ with :
25+ node-version : ' 12.13.1'
26+ - name : Install npm and yarn
27+ run : |
28+ npm install -g yarn
29+ yarn install
30+ - name : Build Vue with yarn
31+ run : yarn build
32+ - name : Install MySQL Client
33+ run : sudo apt update && sudo apt install default-libmysqlclient-dev
34+ - name : Install AWSCLI and AWSEBCLI
35+ run : |
36+ python -m pip install --upgrade pip
37+ pip install -U pipenv
38+ pipenv --bare install
39+ pipenv --bare run pip freeze > requirements.txt
40+ pip install awscli --upgrade
41+ pip install awsebcli --upgrade
42+ - name : Create ElasticBeanstalk configuration folder
43+ run : mkdir .elasticbeanstalk
44+ - name : Write AWS EB config from Secrets
45+ run : printf "%s" "${{ secrets.EB_CONFIG }}" > .elasticbeanstalk/config.yml
46+ - name : Write AWS credentials from Secrets
47+ run : |
48+ mkdir ~/.aws/
49+ echo -e "[default]\naws_access_key_id=${{ secrets.AWS_ACCESS_KEY_ID }}\naws_secret_access_key=${{ secrets.AWS_SECRET_ACCESS_KEY }}" > ~/.aws/credentials
50+ echo -e "[default]\nregion=${{ secrets.AWS_DEFAULT_REGION }}\noutput=json" > ~/.aws/config
51+ - name : Deploy
52+ run : eb deploy ${{ env.EB_ENV_NAME }}
0 commit comments