Skip to content

Commit 10765d9

Browse files
More debugging for google-services json..
1 parent c77514e commit 10765d9

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

.github/workflows/deploy-docker.yml

+8-11
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,34 @@ on:
77

88
jobs:
99
build-and-deploy:
10-
# Run on your self-hosted runner so it has Docker
1110
runs-on: self-hosted
12-
# Alternatively: runs-on: [self-hosted, linux]
1311

1412
steps:
1513
- name: Check out repository
1614
uses: actions/checkout@v3
1715

18-
# Create the google-services.json file from the secret.
1916
- name: Create google-services.json
2017
run: |
21-
# Use printf to preserve formatting/newlines
18+
# Use printf to preserve formatting and newlines
2219
printf "%s" "${{ secrets.GOOGLE_SERVICES_JSON }}" > google-services.json
2320
24-
# Optional: Create .env file from a secret (if needed)
2521
- name: Create .env file
2622
run: |
2723
printf "%s" "${{ secrets.ENV_FILE_CONTENT }}" > .env
2824
29-
# Debug step: check file size so we can verify something was written.
25+
# Debug: Check file size
3026
- name: Check google-services.json file size
3127
run: wc -c google-services.json
3228

29+
# Debug: Validate JSON syntax (this will fail if the JSON is invalid)
30+
- name: Validate google-services.json
31+
run: node -e "JSON.parse(require('fs').readFileSync('google-services.json','utf8'))"
32+
3333
- name: Build Docker image
34-
run: |
35-
docker build -t codebuilder-webapp:latest .
34+
run: docker build -t codebuilder-webapp:latest .
3635

3736
- name: Stop and remove old container (if running)
3837
run: |
39-
# Find any running container based on the image
4038
OLD_CONTAINER_ID=$(docker ps -q --filter ancestor=codebuilder-webapp:latest)
4139
if [ -n "$OLD_CONTAINER_ID" ]; then
4240
echo "Stopping and removing container $OLD_CONTAINER_ID..."
@@ -47,5 +45,4 @@ jobs:
4745
fi
4846
4947
- name: Start new container
50-
run: |
51-
docker run -d --network host -p 3000:3000 --name codebuilder-webapp codebuilder-webapp:latest
48+
run: docker run -d --network host -p 3000:3000 --name codebuilder-webapp codebuilder-webapp:latest

0 commit comments

Comments
 (0)