name: Update Ownsync # Your copy of Ownsync's server, made by the Deploy to Cloudflare button. Press "Run workflow" (Actions tab → # Update Ownsync) when your dashboard says a new version is out: this brings in the latest release, and # Cloudflare redeploys your server from it. Nothing runs on its own. on: workflow_dispatch: permissions: contents: write jobs: update: runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v4 - name: Bring in the latest Ownsync release env: GH_TOKEN: ${{ github.token }} run: | set -euo pipefail tag=$(gh api repos/humanglitch191/ownsync/releases/latest --jq .tag_name) git clone --quiet --depth 1 --branch "$tag" https://github.com/humanglitch191/ownsync /tmp/ownsync # The server is this repository's root (or its server/ folder, if the whole project was copied). dir=.; [ -f wrangler.toml ] || dir=server # Workflow files are left alone: GitHub doesn't let this workflow change them. rsync -a --delete --exclude .git --exclude .github --exclude .gitignore /tmp/ownsync/server/ "$dir/" git add -A if git diff --cached --quiet; then echo "Already on Ownsync $tag."; exit 0; fi git -c user.name="Ownsync updater" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" commit --quiet -m "Update Ownsync to $tag" git push --quiet echo "Updated to Ownsync $tag. Cloudflare redeploys your server in a minute or two."