File tree 1 file changed +66
-0
lines changed
1 file changed +66
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2
+ # More GitHub Actions for Azure: https://github.com/Azure/actions
3
+
4
+ name : Build and deploy PHP app to Azure Web App - d10
5
+
6
+ on :
7
+ push :
8
+ branches :
9
+ - 10.x
10
+ workflow_dispatch :
11
+
12
+ jobs :
13
+ build :
14
+ runs-on : ubuntu-latest
15
+
16
+ steps :
17
+ - uses : actions/checkout@v4
18
+
19
+ - name : Setup PHP
20
+ uses : shivammathur/setup-php@v2
21
+ with :
22
+ php-version : ' 8.3'
23
+
24
+ - name : Check if composer.json exists
25
+ id : check_files
26
+ uses : andstor/file-existence-action@v1
27
+ with :
28
+ files : ' composer.json'
29
+
30
+ - name : Run composer install if composer.json exists
31
+ if : steps.check_files.outputs.files_exists == 'true'
32
+ run : composer validate --no-check-publish && composer install --prefer-dist --no-progress
33
+
34
+ - name : Zip artifact for deployment
35
+ run : zip release.zip ./* -r
36
+
37
+ - name : Upload artifact for deployment job
38
+ uses : actions/upload-artifact@v4
39
+ with :
40
+ name : php-app
41
+ path : release.zip
42
+
43
+ deploy :
44
+ runs-on : ubuntu-latest
45
+ needs : build
46
+ environment :
47
+ name : ' Production'
48
+ url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
49
+
50
+ steps :
51
+ - name : Download artifact from build job
52
+ uses : actions/download-artifact@v4
53
+ with :
54
+ name : php-app
55
+
56
+ - name : Unzip artifact for deployment
57
+ run : unzip release.zip
58
+
59
+ - name : ' Deploy to Azure Web App'
60
+ uses : azure/webapps-deploy@v3
61
+ id : deploy-to-webapp
62
+ with :
63
+ app-name : ' d10'
64
+ slot-name : ' Production'
65
+ package : .
66
+ publish-profile : ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_E2E49DC3B25545EB9B8496BD5007A65F }}
You can’t perform that action at this time.
0 commit comments