autodeploy (gitea)

This commit is contained in:
Aleksandr Yakovlev 2024-10-20 11:21:43 +06:00
parent bed23e9520
commit 065d07675e
No known key found for this signature in database
GPG key ID: 8269E24B4008E32A

View file

@ -0,0 +1,33 @@
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 }}