From f19766c24922f5118d301dc5d79e1d4a4907ab9e Mon Sep 17 00:00:00 2001 From: johnlee-sumo Date: Mon, 1 Jul 2024 14:59:18 +0800 Subject: [PATCH 1/3] db config --- config/database.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/database.php b/config/database.php index 137ad18ce..7f9ed3463 100644 --- a/config/database.php +++ b/config/database.php @@ -46,11 +46,11 @@ 'mysql' => [ 'driver' => 'mysql', 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), + 'host' => env('AZURE_MYSQL_HOST', '127.0.0.1'), + 'port' => env('AZURE_MYSQL_PORT', '3306'), + 'database' => env('AZURE_MYSQL_DBNAME', 'forge'), + 'username' => env('AZURE_MYSQL_USERNAME', 'forge'), + 'password' => env('AZURE_MYSQL_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', From f2a4f5b346dfbce068c69f5bdbef86ee320b7d36 Mon Sep 17 00:00:00 2001 From: johnlee-sumo Date: Mon, 1 Jul 2024 15:15:45 +0800 Subject: [PATCH 2/3] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_sumbv1.yml | 75 +++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/main_sumbv1.yml diff --git a/.github/workflows/main_sumbv1.yml b/.github/workflows/main_sumbv1.yml new file mode 100644 index 000000000..b7f090a3c --- /dev/null +++ b/.github/workflows/main_sumbv1.yml @@ -0,0 +1,75 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy PHP app to Azure Web App - sumbv1 + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Check if composer.json exists + id: check_files + uses: andstor/file-existence-action@v1 + with: + files: 'composer.json' + + - name: Run composer install if composer.json exists + if: steps.check_files.outputs.files_exists == 'true' + run: composer validate --no-check-publish && composer install --prefer-dist --no-progress + + - name: Zip artifact for deployment + run: zip release.zip ./* -r + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: php-app + path: release.zip + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + permissions: + id-token: write #This is required for requesting the JWT + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: php-app + + - name: Unzip artifact for deployment + run: unzip release.zip + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_4C360F3259E840D0BE95ADB26C71B0F8 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_9FF991F85A8741A6939A3888F47F2D1A }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_42135EDC6626477B927D32479A0CA30E }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'sumbv1' + slot-name: 'Production' + package: . + \ No newline at end of file From ebac1702b7af0aac716c5e398bbaa1b3ebb1a63b Mon Sep 17 00:00:00 2001 From: johnlee-sumo Date: Mon, 1 Jul 2024 16:53:46 +0800 Subject: [PATCH 3/3] already exists error --- .../2014_10_12_100000_create_password_reset_tokens_table.php | 1 + 1 file changed, 1 insertion(+) diff --git a/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php b/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php index 81a7229b0..f25e5d5c1 100644 --- a/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php +++ b/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php @@ -11,6 +11,7 @@ */ public function up(): void { + Schema::dropIfExists('password_reset_tokens'); Schema::create('password_reset_tokens', function (Blueprint $table) { $table->string('email')->primary(); $table->string('token');