-
Notifications
You must be signed in to change notification settings - Fork 4
33 lines (26 loc) · 1.07 KB
/
deploy.yaml
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
name: Deploy code to Elastic Beanstalk
on:
push:
branches:
- "master"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create a deployment package
run: zip -r package.zip ./
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ca-central-1
- name: Upload package to s3
run: aws s3 cp package.zip s3://github-user-stats-eb/
- name: Create app version
run: |
aws elasticbeanstalk create-application-version --application-name github-user-stats --version-label "version-${{ github.sha }}" --source-bundle S3Bucket="github-user-stats-eb",S3Key="package.zip" --description "commit-${{ github.sha }}"
- name: Deploy new app version
run: |
aws elasticbeanstalk update-environment --environment-name github-user-stats-dev --version-label "version-${{ github.sha }}"