xref: /plugin/dev/.github/workflows/deploy.yml (revision 9e2c1a8afcc1916690eb64101b08bf6f794356c9)
1name: deployment
2on:
3  push:
4    branches:
5      - master
6jobs:
7  deploy:
8    runs-on: ubuntu-latest
9    steps:
10      - name: Checkout
11        uses: actions/checkout@v3
12
13      - name: Setup PHP
14        uses: shivammathur/setup-php@v2
15        with:
16          php-version: 7.4
17
18      - name: Run Composer
19        run: composer install
20
21      - name: Setup SSH Key
22        uses: shimataro/ssh-key-action@v2
23        with:
24          key: ${{ secrets.SSH_PRIVATE_KEY }}
25          # generate with ssh-keyscan -H <server>
26          known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
27
28      - name: Deploy to Server
29        run: |
30          rsync -avz ./ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.TARGET_DIR }}
31
32