Kontakt #15
This file contains hidden or 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: Deploy Site to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Build bus app | |
| run: | | |
| cd bus | |
| npm ci | |
| npm run build | |
| cp build/index.html build/404.html | |
| - name: Prepare full site for deployment | |
| run: | | |
| mkdir -p _site | |
| # Copy all root files (HTML, CSS, JS, assets) | |
| cp -r *.html *.css *.js *.png *.ico *.json _site/ 2>/dev/null || true | |
| # Copy kodovi folder | |
| cp -r kodovi _site/ 2>/dev/null || true | |
| # Copy any other folders except bus source, node_modules, .git | |
| for dir in */; do | |
| if [[ "$dir" != "bus/" && "$dir" != "node_modules/" && "$dir" != ".git/" && "$dir" != "_site/" ]]; then | |
| cp -r "$dir" _site/ | |
| fi | |
| done | |
| # Copy built bus app | |
| cp -r bus/build _site/bus | |
| - name: Deploy to gh-pages branch | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./_site | |
| keep_files: false |