Skip to content

Commit 4916157

Browse files
Merge pull request #12 from Rajesh-Nagarajan-11/fix-1
offcial
2 parents c8155d1 + 9b4bf2e commit 4916157

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/preview-site.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,21 @@ jobs:
2727
unzip public-dir.zip
2828
rm -f public-dir.zip
2929
30+
- name: Debug - Check public directory
31+
run: |
32+
echo "Contents of public directory:"
33+
ls -la public/
34+
echo "Total size of public directory:"
35+
du -sh public/
36+
3037
- name: Deploy to Netlify
3138
id: netlify
32-
uses: nwtgck/actions-netlify@v3.0
33-
with:
34-
publish-dir: 'public'
35-
production-deploy: false
36-
github-token: ${{ secrets.GH_ACCESS_TOKEN }}
37-
enable-commit-comment: false
39+
run: |
40+
npm install -g netlify-cli
41+
netlify deploy --dir=public --site=$NETLIFY_SITE_ID --auth=$NETLIFY_AUTH_TOKEN --message="Deploy from GitHub Actions" > deploy_output.txt 2>&1
42+
cat deploy_output.txt
43+
DEPLOY_URL=$(grep -o 'Website draft URL: https://[^[:space:]]*' deploy_output.txt | sed 's/Website draft URL: //')
44+
echo "deploy-url=$DEPLOY_URL" >> $GITHUB_OUTPUT
3845
env:
3946
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
4047
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

0 commit comments

Comments
 (0)