-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (39 loc) · 1.63 KB
/
deploy_dev.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: HydroServer Dev AWS Elastic Beanstalk Deployment
run-name: ${{ github.actor }} is deploying HydroServer Dev to AWS Elastic Beanstalk on ${{ github.ref }}
on:
workflow_run:
workflows: ["HydroServer Tests"]
branches:
- dev
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: dev
- name: Create deployment package
run: zip -r deploy_package.zip ./
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: 'us-east-1'
- name: Upload deployment package to S3
run: aws s3 cp deploy_package.zip s3://hydroserver/deployment/dev/deploy_package_${{ github.event.workflow_run.head_sha }}.zip
- name: Create ElasticBeanstalk Application Version
run: |
aws elasticbeanstalk create-application-version \
--application-name hydroserver-dev \
--source-bundle S3Bucket="hydroserver",S3Key="deployment/dev/deploy_package_${{ github.event.workflow_run.head_sha }}.zip" \
--version-label "${{ github.event.workflow_run.head_sha }}" \
--description "commit-sha-${{ github.event.workflow_run.head_sha }}"
- name: Deploy ElasticBeanstalk Application Version
run: |
aws elasticbeanstalk update-environment \
--environment-name hydroserver-dev-env \
--version-label "${{ github.event.workflow_run.head_sha }}"