File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy PR previews
2+
3+ on : pull_request
4+
5+ concurrency : preview-${{ github.ref }}
6+
7+ jobs :
8+ deploy-preview :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+ - name : Setup Node
13+ uses : actions/setup-node@v4
14+ with :
15+ node-version : 20
16+ - name : Set up php 8.4
17+ uses : shivammathur/setup-php@v2
18+ with :
19+ php-version : 8.4
20+ - name : Set up PHP dependencie
21+ run : composer i
22+ - name : Change config.php
23+ run : |
24+ sed -i "s|librecode.coop|librecode.github.io|g" CNAME
25+ sed -i "s|'baseUrl' => '/'|'baseUrl' => 'https://LibreCodeCoop.github.io/site-preview/pr-preview/pr-${{ github.event.pull_request.number }}/'|g" config.php
26+ cat config.php|grep "'baseUrl' => "
27+ sed -i "/'matomo_container'/d" config.production.php
28+ - name : Run composer command
29+ run : composer prod
30+
31+ - name : Deploy preview
32+ uses : rossjrw/pr-preview-action@v1
33+ with :
34+ source-dir : ./build_production/
35+ pages-base-url : librecode.github.io/site-preview
36+ deploy-repository : LibreCodeCoop/site-preview
37+ preview-branch : main
38+ token : ${{ secrets.PREVIEW_TOKEN }}
You can’t perform that action at this time.
0 commit comments