Skip to content

Commit

Permalink
(TOBE REMOVED) test
Browse files Browse the repository at this point in the history
  • Loading branch information
BEMELON committed Nov 29, 2023
1 parent 86d9810 commit 095088b
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,21 @@ jobs:
- name: Modify Repository Address in Dockerrun.aws.json
env:
ECR_REPOSITORY_ADDRESS: ${{ github.ref == 'refs/heads/master' && secrets.AWS_ECR_ADDRESS || secrets.AWS_DEV_ECR_ADDRESS }}

run: |
import json
with open('Dockerrun.aws.json', 'r') as f:
data = json.load(f)
data['Image']['Name'] = '${{ env.ECR_REPOSITORY_ADDRESS }}'
with open('current-Dockerrun.aws.json', 'w') as f:
json.dump(data, f, indent=4)
- name: Generate deployment package
run: |
mkdir -p deploy
cp current-Dockerrun.aws.json deploy/Dockerrun.aws.json
cd deploy && zip -r deploy.zip .
echo "import os, json" > modify.py
echo "with open('Dockerrun.aws.json', 'r') as f:" >> modify.py
echo " data = json.load(f)" >> modify.py
echo "data['Image']['Name'] = os.environ['ECR_REPOSITORY_ADDRESS']" >> modify.py
echo "with open('current-Dockerrun.aws.json', 'w') as f:" >> modify.py
echo " json.dump(data, f, indent=4)" >> modify.py
python modify.py
- name: Generate deployment package
run: |
mkdir -p deploy
cp current-Dockerrun.aws.json deploy/Dockerrun.aws.json
cd deploy && zip -r deploy.zip .
mv deploy.zip ../deploy.zip
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v14
env:
Expand Down

0 comments on commit 095088b

Please sign in to comment.