-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.61 KB
/
Copy pathdeploy-php.yml
File metadata and controls
57 lines (48 loc) · 1.61 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
50
51
52
53
54
55
56
57
name: Deploy to ThePlayground
on:
push:
branches: [ "master" ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: mbstring, intl, json, pdo, pdo_mysql
- name: Install Composer dependencies
run: composer install --no-interaction --no-dev --optimize-autoloader
# Static lint check
- name: PHP lint
run: |
find ./ -type f -name "*.php" -print0 | xargs -0 -n1 php -l
# PHPUnit tests (optional)
- name: Run tests
if: ${{ hashFiles('phpunit.xml', 'phpunit.xml.dist') != '' }}
run: vendor/bin/phpunit --colors=never
- name: Prepare build
run: |
mkdir build
rsync -av \
--exclude=".git" \
--exclude=".github" \
--exclude="build" \
./ build/
- name: Dry-run deploy to theplayground.ws
uses: easingthemes/ssh-deploy@v5.0.0
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
REMOTE_HOST: ${{ secrets.SSH_HOST }}
REMOTE_USER: ${{ secrets.SSH_USER }}
REMOTE_PORT: ${{ secrets.SSH_PORT }}
TARGET: "/home/cerberus/public_html/theplayground"
SOURCE: "build/"
ARGS: "--dry-run --delete --verbose --filter='P .well-known/' --filter='P cgi-bin/' --filter='P .ftpquota' --filter='P .htaccess'"
EXCLUDE: |
.well-known
cgi-bin
.ftpquota
.htaccess