Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
50b70a4
Update index.html
SmithaVerity Dec 8, 2023
082fe09
Update index.html
SmithaVerity Dec 12, 2023
8c9322f
Create README.md
SmithaVerity Dec 12, 2023
bf3fdb4
Update README.md
SmithaVerity Dec 12, 2023
a6a9142
Update README.md
SmithaVerity Dec 12, 2023
09aa7f1
Update index.html
SmithaVerity Dec 12, 2023
f26d548
Add or update the Azure App Service build and deployment workflow config
SmithaVerity Dec 19, 2023
fda5d9d
Update index.html
SmithaVerity Dec 19, 2023
0427e2e
Update index.html
SmithaVerity Dec 19, 2023
7f40f0e
Update index.html
SmithaVerity Dec 19, 2023
3d8ea25
Add or update the Azure App Service build and deployment workflow config
SmithaVerity Mar 22, 2024
3f81c9c
Delete .github/workflows directory
SmithaVerity Mar 22, 2024
0304546
Update index.html
SmithaVerity Mar 22, 2024
fc055b0
Update index.html
SmithaVerity Mar 22, 2024
001b5b1
Update deployServer.sh
SmithaVerity Mar 22, 2024
d6d81fe
Update deployServer.sh
SmithaVerity Mar 22, 2024
76a1416
Update deployServer.sh
SmithaVerity Mar 22, 2024
378ea54
Update deployServer.sh
SmithaVerity Mar 25, 2024
044bab2
Add or update the Azure App Service build and deployment workflow config
SmithaVerity Mar 26, 2024
ad47b32
Add or update the Azure App Service build and deployment workflow config
padmavathiboddu Mar 26, 2024
9154263
Delete .github/workflows directory
padmavathiboddu Mar 26, 2024
cc166a6
Add or update the Azure App Service build and deployment workflow config
padmavathiboddu Mar 26, 2024
351e1fd
Update index.html
padmavathiboddu Mar 26, 2024
4d27e48
Add or update the Azure App Service build and deployment workflow config
padmavathiboddu Mar 26, 2024
e2a2ed2
Remove the Azure App Service build and deployment workflow config
padmavathiboddu Mar 26, 2024
778b548
Add or update the Azure App Service build and deployment workflow config
padmavathiboddu Mar 26, 2024
9632813
Update index.html
padmavathiboddu Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# 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:
build:
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
Expand All @@ -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 }}
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -31,30 +31,45 @@ 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'
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: .

15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
```
29 changes: 26 additions & 3 deletions cafe/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Creates `window.growthbook` with all of the exported classes -->
<script src="https://cdn.jsdelivr.net/npm/@growthbook/growthbook/dist/bundles/index.js"></script>
<script src="https://www.googleoptimize.com/optimize.js?id=OPT-N3GHGDW"></script>
<title>Home</title>
<meta charset="utf-8">
Expand All @@ -27,7 +29,6 @@

<script src='js/device.min.js'></script>
</head>

<body>
<div class="page">
<!--========================================================
Expand Down Expand Up @@ -61,7 +62,7 @@

<div class="brand wow fadeIn">
<h1 class="brand_name">
<a href="./">Cafe</a>
<a href="./">PY's Cafe</a>
</h1>
</div>
</div>
Expand Down Expand Up @@ -292,6 +293,28 @@ <h2><em>Make </em>a Reservation</h2>
</footer>
</div>

<script src="js/script.js"></script>
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.9.0/firebase-app.js";
import { getAnalytics } from "https://www.gstatic.com/firebasejs/10.9.0/firebase-analytics.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries

// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyDbI7w0aSQ53gGoRdtNKWN36cg40hCpYGM",
authDomain: "smithatest1-76514.firebaseapp.com",
projectId: "smithatest1-76514",
storageBucket: "smithatest1-76514.appspot.com",
messagingSenderId: "988011346266",
appId: "1:988011346266:web:7810cfe8596c20a3a89b63",
measurementId: "G-DHRQ6783Q7"
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
</script>
</body>
</html>
3 changes: 3 additions & 0 deletions deployServer.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sudo apt update && sudo apt install apache2 -y
# 20/3/2024 Added for Firebase AB Testing. But AB testing of web app using Remote Config not enabled yet in Firebase.
# sudo apt install nodejs npm -y
# sudo npm install firebase -y
sudo mv cafe /var/www/html

cd /var/www/html
Expand Down