Add build directory for direct Coolify deployment #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy Static Files | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install Dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
env: | |
VITE_API_URL: https://api.mumbaiflood.in | |
- name: Create serve.json | |
run: | | |
echo '{ | |
"public": "build", | |
"port": 3000, | |
"directoryListing": false | |
}' > serve.json | |
- name: Commit and Push Build | |
run: | | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email '[email protected]' | |
git add build/ serve.json | |
git commit -m "Auto-generated static build" | |
git push |