Skip to content

Commit 5439fd2

Browse files
committed
feat: add VITE_APP_API_URL variable check and include it in Docker build environment
1 parent fa9fe99 commit 5439fd2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
[[ -n "${{ secrets.SERVER_SSH_KEY }}" ]] || { echo "❌ SERVER_SSH_KEY secret missing"; exit 1; }
2020
[[ -n "${{ vars.DOCKER_COMPOSE_DIR }}" ]] || { echo "❌ DOCKER_COMPOSE_DIR variable missing"; exit 1; }
2121
[[ -n "${{ vars.DOCKER_COMPOSE_SERVICE }}" ]] || { echo "❌ DOCKER_COMPOSE_SERVICE variable missing"; exit 1; }
22+
[[ -n "${{ vars.VITE_APP_API_URL }}" ]] || { echo "❌ VITE_APP_API_URL variable missing"; exit 1; }
2223
echo "✅ All secrets and variables configured"
2324
2425
build:
@@ -33,9 +34,14 @@ jobs:
3334
- name: Set up Docker Buildx
3435
uses: docker/setup-buildx-action@v3
3536

37+
- name: Create .env file
38+
run: |
39+
cp env/.env.example env/.env
40+
echo -e "\n" >> env/.env
41+
echo "VITE_APP_API_URL=${{vars.VITE_APP_API_URL}}" >> env/.env
42+
3643
- name: Build Docker image
3744
run: |
38-
echo "IMAGE_NAME=weather-web-fe-build-gha" >> $GITHUB_ENV
3945
docker build -t weather-web-fe-build-gha:latest .
4046
4147
- name: Save Docker image to tarball

0 commit comments

Comments
 (0)