From 07f063476fd4b4944c6015be8702471b5737db58 Mon Sep 17 00:00:00 2001 From: Sunil Tanuku Date: Thu, 22 Sep 2022 14:26:51 +0530 Subject: [PATCH 1/3] Create main.yml --- .github/workflows/main.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9f0ebb8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,36 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "master" branch + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. From ef0d299153c906e4daeb1d2db03a3564db33a1cb Mon Sep 17 00:00:00 2001 From: Sunil Tanuku Date: Thu, 22 Sep 2022 14:30:50 +0530 Subject: [PATCH 2/3] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/master_moodle2.yml | 60 ++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/master_moodle2.yml diff --git a/.github/workflows/master_moodle2.yml b/.github/workflows/master_moodle2.yml new file mode 100644 index 0000000..b4f4fa9 --- /dev/null +++ b/.github/workflows/master_moodle2.yml @@ -0,0 +1,60 @@ +# 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 - Moodle2 + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + + - 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: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + with: + name: php-app + path: . + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: php-app + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v2 + id: deploy-to-webapp + with: + app-name: 'Moodle2' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_F7207E395E5542C4B26143C69FA19DC7 }} + package: . From 2f116d04fa28b4bdef228e600dab845148f108ce Mon Sep 17 00:00:00 2001 From: Sunil Tanuku Date: Thu, 22 Sep 2022 14:32:30 +0530 Subject: [PATCH 3/3] Update composer.json --- composer.json | 71 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 08f03a6..c33f73d 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,68 @@ { - "require": { - "php": ">=5.6", - "ext-curl": "*", - "authorizenet/authorizenet": ">=2.0 || <2.1" - } + "name": "laravel/laravel", + "type": "project", + "description": "The Laravel Framework.", + "keywords": ["framework", "laravel"], + "license": "MIT", + "require": { + "php": "^8.0.2", + "codedge/laravel-fpdf": "^1.8", + "fruitcake/laravel-cors": "^2.0.5", + "guzzlehttp/guzzle": "^7.2", + "laravel/framework": "^9.0", + "laravel/sanctum": "^2.14", + "laravel/tinker": "^2.7", + "laravel/ui": "^3.4", + "setasign/tfpdf": "1.32" + }, + "require-dev": { + "fakerphp/faker": "^1.9.1", + "laravel/sail": "^1.14", + "mockery/mockery": "^1.4.4", + "nunomaduro/collision": "^6.1", + "phpunit/phpunit": "^9.5.10", + "spatie/laravel-ignition": "^1.0" + }, + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Factories\\": "database/factories/", + "Database\\Seeders\\": "database/seeders/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + }, + "files": [ + "app/Helpers/Helpers.php" + ] + }, + "scripts": { + "post-autoload-dump": [ + "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", + "@php artisan package:discover --ansi" + ], + "post-update-cmd": [ + "@php artisan vendor:publish --tag=laravel-assets --ansi --force" + ], + "post-root-package-install": [ + "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" + ], + "post-create-project-cmd": [ + "@php artisan key:generate --ansi" + ] + }, + "extra": { + "laravel": { + "dont-discover": [] + } + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true + }, + "minimum-stability": "dev", + "prefer-stable": true }