Skip to content

Commit f856b87

Browse files
authored
chore(cd): GitHub Actions 배포 환경 변수 및 .env 생성 로직 추가
1 parent dad82a3 commit f856b87

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/cd.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,21 @@ jobs:
4444
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
4545
aws-region: ${{ env.AWS_REGION }}
4646

47-
- name: Move appspec.yml to root
48-
run: mv ./FixLog_Server/appspec.yml .
47+
- name: Create .env file from GitHub secrets
48+
run: |
49+
echo "mysql_url=${{ secrets.mysql_url }}" >> .env
50+
echo "mysql_username=${{ secrets.mysql_username }}" >> .env
51+
echo "mysql_password=${{ secrets.mysql_password }}" >> .env
52+
echo "jwt_key=${{ secrets.jwt_key }}" >> .env
53+
54+
- name: Move appspec.yml to root if necessary
55+
run: |
56+
if [ -f ./FixLog_Server/appspec.yml ]; then
57+
mv ./FixLog_Server/appspec.yml .
58+
fi
4959
5060
- name: Zip deploy package
51-
run: zip -r ${{ github.sha }}.zip .
61+
run: zip -r ${{ github.sha }}.zip . -x ".git/*"
5262

5363
- name: Upload to S3
5464
run: |

0 commit comments

Comments
 (0)