-
Notifications
You must be signed in to change notification settings - Fork 20
45 lines (36 loc) · 1.51 KB
/
deploy.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
39
40
41
42
43
44
45
name: deploy-to-eb
on:
push:
branches: [ deploy ]
env:
ELASTIC_BEANSTALK_NAME: iiif-website-validators
ELASTIC_BEANSTALK_ENV_NAME: iiif-image-validator-python-3
BUCKET: codepipeline-us-east-1-740788099428
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# creating zip file
- name: Create ZIP deployment package
run: zip -r ${{github.run_id}}.zip ./
# Configuring credentials
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }}
aws-region: "us-east-1"
# This bucket needs to be encrypted
- name: Upload package to S3 bucket
run: aws s3 cp ${{github.run_id}}.zip s3://$BUCKET/iiif-image-validator/MyApp/ --sse aws:kms
- name: Create new ElasticBeanstalk Application Version
run: |
aws elasticbeanstalk create-application-version \
--application-name $ELASTIC_BEANSTALK_NAME \
--source-bundle S3Bucket=$BUCKET,S3Key="iiif-image-validator/MyApp/${{github.run_id}}.zip" \
--version-label "ver-${{ github.sha }}" \
--description "commit-sha-${{ github.sha }}"
# deploy application
- name: Deploy new ElasticBeanstalk Application Version
run: aws elasticbeanstalk update-environment --environment-name $ELASTIC_BEANSTALK_ENV_NAME --version-label "ver-${{ github.sha }}"