ifhub-telegram/.forgejo/workflows/deploy.yaml

33 lines
1 KiB
YAML

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: docker
container:
image: "oreolek/php8node:latest"
env:
phpver: "8.3"
path: ${{ github.ref == 'refs/heads/main' && secrets.DEPLOY_PATH_MAIN }}
steps:
- name: Set up git permissions
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Get latest code
uses: "https://code.forgejo.org/actions/checkout@v4"
- name: Install Composer dependencies
uses: "https://github.com/ramsey/composer-install@v3"
with:
composer-options: "--no-dev --optimize-autoloader"
- name: Sync files
uses: "https://github.com/burnett01/rsync-deployments@7.0.1"
with:
switches: "-avzr --exclude='/.git' --exclude={'/.editorconfig','/.forgejo','/tests'}"
remote_path: ${{ env.path }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}