diff --git a/.github/workflows/main_smithaapp.yml b/.github/workflows/green_padmavathiapp(green).yml similarity index 67% rename from .github/workflows/main_smithaapp.yml rename to .github/workflows/green_padmavathiapp(green).yml index 8a46a0f..7652476 100644 --- a/.github/workflows/main_smithaapp.yml +++ b/.github/workflows/green_padmavathiapp(green).yml @@ -1,12 +1,12 @@ # 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 - smithaapp +name: Build and deploy PHP app to Azure Web App - padmavathiapp on: push: branches: - - main + - green workflow_dispatch: jobs: @@ -14,12 +14,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.2' - name: Check if composer.json exists id: check_files @@ -31,30 +31,36 @@ jobs: 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@v2 + uses: actions/upload-artifact@v3 with: name: php-app - path: . + path: release.zip deploy: runs-on: ubuntu-latest needs: build environment: - name: 'Production' + name: 'green' url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - + steps: - name: Download artifact from build job - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: php-app + - name: Unzip artifact for deployment + run: unzip release.zip + - name: 'Deploy to Azure Web App' uses: azure/webapps-deploy@v2 id: deploy-to-webapp with: - app-name: 'smithaapp' - slot-name: 'Production' - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_434C54A8A0124364B61A9A0EDD39F03C }} + app-name: 'padmavathiapp' + slot-name: 'green' package: . + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D172A90611E6446EBD97E9512CAAF291 }} \ No newline at end of file diff --git a/.github/workflows/main_smithacafeapp.yml b/.github/workflows/main_padmavathiapp.yml similarity index 56% rename from .github/workflows/main_smithacafeapp.yml rename to .github/workflows/main_padmavathiapp.yml index 906165b..e8a6739 100644 --- a/.github/workflows/main_smithacafeapp.yml +++ b/.github/workflows/main_padmavathiapp.yml @@ -1,7 +1,7 @@ # 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 - smithacafeapp +name: Build and deploy PHP app to Azure Web App - PadmavathiApp on: push: @@ -14,12 +14,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: '8.2' - name: Check if composer.json exists id: check_files @@ -31,11 +31,14 @@ jobs: 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@v2 + uses: actions/upload-artifact@v3 with: name: php-app - path: . + path: release.zip deploy: runs-on: ubuntu-latest @@ -43,18 +46,30 @@ jobs: 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@v2 + uses: actions/download-artifact@v3 with: name: php-app + - name: Unzip artifact for deployment + run: unzip release.zip + + - name: Login to Azure + uses: azure/login@v1 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_5CB4CC18348D443CAF2C770A470F8884 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_A9C6603119674C0E9E5EEE09459F8BB6 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_58D3C255EBA748A6BEC55A8DC8D6DE2F }} + - name: 'Deploy to Azure Web App' uses: azure/webapps-deploy@v2 id: deploy-to-webapp with: - app-name: 'smithacafeapp' + app-name: 'PadmavathiApp' slot-name: 'Production' - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_FE215841368342B8891F24352F41CFE8 }} package: . + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb7aa6b --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# AB Testing Server Cafe app + +Create an ubuntu instance. + +Connect the instance using putty and then run the below script +``` +git clone https://github.com/SmithaVerity/ABTestingApp.git +cd ABTestingApp/ +sh deployServer.sh +``` + +For updates +``` +sh updateApp.sh +``` diff --git a/cafe/index.html b/cafe/index.html index e2201e8..828142f 100644 --- a/cafe/index.html +++ b/cafe/index.html @@ -1,6 +1,8 @@
+ +