chore: try to fix reloads #4
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: Build and Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout 🛎️ | |
| uses: actions/checkout@v4 | |
| # we need two build steps because paths.base differs | |
| # (GitHub Pages => deploys to subdirectory <user>.github.io/<repo>/) | |
| # TODO: re-add later (remove `npm ci` from ftp step) | |
| # TODO: check https://svelte.dev/docs/kit/adapter-static#GitHub-Pages for latest info | |
| # - name: Install and Build for Github Pages 🔧 | |
| # run: | | |
| # npm ci | |
| # npm run build | |
| # env: | |
| # #important: deploy to subdirectory, relative links must be differend | |
| # PATHS_BASE: '/${{ github.event.repository.name }}' | |
| # - name: Deploy 🚀 | |
| # uses: JamesIves/[email protected] | |
| # with: | |
| # branch: gh-pages # The branch the action should deploy to. | |
| # folder: build # The folder the action should deploy. | |
| - name: Build again for SFTP transfer 🔧 | |
| run: | | |
| npm ci | |
| npm run build | |
| env: | |
| PATHS_BASE: "" # deploy to (sub)domain root | |
| # For my site, I use a quick hack to let SvelteKit handle all traffic, expect for /blog (handled by a | |
| # WordPress site), see https://gist.github.com/mandrasch/46a00c3ba6cd30efd183509f1ebb4f3d. | |
| # This deployement here goes directly to /matthias-andrasch.eu/sveltekit | |
| - name: 📂 Sync files via sftp | |
| uses: SamKirkland/[email protected] | |
| with: | |
| local-dir: ./build/ | |
| server: ${{ secrets.ftp_host }} | |
| username: ${{ secrets.ftp_user }} | |
| password: ${{ secrets.ftp_password }} |