Validate .env creation in deploy workflow

This commit is contained in:
Lectom C Han
2026-02-04 14:56:56 +09:00
parent 02f40e9cc3
commit c55f469f97

View File

@@ -20,11 +20,18 @@ jobs:
key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
port: ${{ vars.SSH_PORT }} port: ${{ vars.SSH_PORT }}
script: | script: |
set -e
cd ${{ secrets.DEPLOY_PATH }} cd ${{ secrets.DEPLOY_PATH }}
cat << 'ENVEOF' > .env cat << 'ENVEOF' > .env
${{ secrets.DEPLOY_ENV_FILE }} ${{ secrets.DEPLOY_ENV_FILE }}
ENVEOF ENVEOF
# .env가 비어 있으면 중단
if [ ! -s .env ]; then
echo ".env가 비어 있습니다. DEPLOY_ENV_FILE 설정을 확인하세요."
exit 1
fi
# Export variables from .env file # Export variables from .env file
set -a set -a
source .env source .env