-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (45 loc) · 1.57 KB
/
main.yml
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: Build & Deploy
on:
push:
tags:
- "v*"
branches:
- main
env:
NODE_VERSION: '13.x'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install composer dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: PHPStan - Static code analysis
run: vendor/bin/phpstan analyse --memory-limit=256M
- name: PHP CodeSniffer
run: vendor/bin/phpcs
- name: Remove dev composer dependencies
run: composer install --no-dev
- name: Cleanup directory
run: |
rm -rf .bowerrc .git .github .phpstan _migration tests
rm .gitignore *.json *.lock docker-compose.yml Dockerfile phpstan.neon requirements.php webpack.config.js
- name: Deploy to server via scp
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
port: 22
source: "."
target: "/home/${{ secrets.SSH_USERNAME }}/public_html/ch.electricbass"
- name: Execute remote ssh commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
port: 22
script: php80 /home/${{ secrets.SSH_USERNAME }}/public_html/ch.electricbass/yii migrate/up --interactive=0