-
Notifications
You must be signed in to change notification settings - Fork 8
49 lines (45 loc) · 1.85 KB
/
Copy pathpreview.yml
File metadata and controls
49 lines (45 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Deploy PR previews
on: pull_request
concurrency:
group: site-preview-deploy
cancel-in-progress: false
jobs:
deploy-preview:
# Skip fork PRs (e.g. Weblate translations) — secrets are not available
# for forks and a visual preview is not useful for translation-only changes.
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
env:
WC_CONSUMER_KEY: ${{ secrets.WC_CONSUMER_KEY }}
WC_CONSUMER_SECRET: ${{ secrets.WC_CONSUMER_SECRET }}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up php 8.3
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- name: Set up PHP dependencie
run: composer i
- name: Change config.php
run: |
sed -i "s|libresign.coop|libresign.github.io|g" CNAME
sed -i "s|baseUrl' => '/'|baseUrl' => 'https://LibreSign.github.io/site-preview/pr-preview/pr-${{ github.event.pull_request.number }}/'|g" config.php
sed -i "s|base: '/assets/build/'|base: 'https://libresign.github.io/site-preview/pr-preview/pr-${{ github.event.pull_request.number }}/assets/build/'|g" vite.config.js
cat config.php|grep "'baseUrl' => "
sed -i "/'matomo_container'/d" config.production.php
- name: Run composer command
run: composer prod
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./build_production/
pages-base-url: libresign.github.io/site-preview
deploy-repository: LibreSign/site-preview
preview-branch: main
wait-for-pages-deployment: false
token: ${{ secrets.PREVIEW_TOKEN }}
comment: ${{ github.event.pull_request.user.type != 'Bot' }}