diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml new file mode 100644 index 0000000..4522f3d --- /dev/null +++ b/.forgejo/workflows/deploy.yaml @@ -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 }}