name: Set DB_DATABASE, DB_USERNAME, and DB_PASSWORD
run: |
sed -i "s/DB_DATABASE=./DB_DATABASE=${{ secrets.DB_DATABASE }}/" .env
sed -i "s/DB_USERNAME=./DB_USERNAME=${{ secrets.DB_USERNAME }}/" .env
sed -i "s/DB_PASSWORD=./DB_PASSWORD=${{ secrets.DB_PASSWORD }}/" .env
sed -i "s/APP_ENV=./APP_ENV=production/" .env
sed -i "s/APP_DEBUG=.*/APP_DEBUG=false/" .env
`name: š Deploy website on push on: push: branches:
main jobs: web-deploy: name: š Deploy runs-on: ubuntu-latest env: LARAVEL_BYPASS_ENV_CHECK: 1 # Set the environment variable steps:
- name: Get the latest code
name: š Get latest code uses: actions/checkout@v4
uses: actions/checkout@v4
uses: actions/setup-node@master
name: Copy .env run: php -r "file_exists('.env') || copy('.env.example', '.env');"
name: Set DB_DATABASE, DB_USERNAME, and DB_PASSWORD run: | sed -i "s/DB_DATABASE=./DB_DATABASE=${{ secrets.DB_DATABASE }}/" .env sed -i "s/DB_USERNAME=./DB_USERNAME=${{ secrets.DB_USERNAME }}/" .env sed -i "s/DB_PASSWORD=./DB_PASSWORD=${{ secrets.DB_PASSWORD }}/" .env sed -i "s/APP_ENV=./APP_ENV=production/" .env sed -i "s/APP_DEBUG=.*/APP_DEBUG=false/" .env
name: Install Dependencies run: composer update --ignore-platform-reqs
name: Generate key run: php artisan key:generate
name: Generate storage link run: php artisan storage:link
name: Directory Permissions run: chmod -R 777 storage bootstrap/cache
name: Clear Application Cache run: php artisan cache:clear
name: Compile Assets (npm run dev) run: npm install && npm run build
name: Publish Livewire Assets run: php artisan livewire:publish --assets
name: š Sync files
uses: SamKirkland/FTP-Deploy-Action@4.0.0
`