Merge pull request #2 from Velocity-Developer/main #2
Workflow file for this run
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 Laravel to Hosting | |
| on: | |
| push: | |
| branches: | |
| - prod # ganti sesuai branch yang kamu gunakan | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' # versi PHP hosting | |
| - name: Upload via FTP | |
| uses: SamKirkland/FTP-Deploy-Action@v4.3.5 | |
| with: | |
| server: ${{ secrets.FTP_SERVER }} | |
| username: ${{ secrets.FTP_USERNAME }} | |
| password: ${{ secrets.FTP_PASSWORD }} | |
| server-dir: /laravel/ # sesuaikan dengan folder hosting | |
| local-dir: ./ # kalau mau hanya folder tertentu, ganti | |
| exclude: | | |
| .env | |
| public/storage/** | |
| public/uploads/** | |
| storage/** | |
| vendor/** | |
| .git/** | |
| .github/** | |
| .vscode/** | |
| node_modules/** | |
| dangerous-clean-slate: false | |
| - name: Clear Laravel cache (opsional) | |
| run: | | |
| echo "Clearing Laravel cache via FTP/Shell not implemented automatically" |