This commit is contained in:
@@ -1,17 +1,15 @@
|
|||||||
name: Sync public mirror
|
name: Sync public mirror
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ] # change if your default branch is different
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: alpine:3.20 # small & fast container; reduces system load
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install tools (bash, rsync, git, openssh)
|
- name: Install tools (rsync)
|
||||||
run: |
|
run: |
|
||||||
apk add --no-cache bash rsync git openssh-client
|
sudo apt-get update && sudo apt-get install -y rsync
|
||||||
|
|
||||||
- name: Checkout private repo
|
- name: Checkout private repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -35,16 +33,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Sync files (snapshot, safe)
|
- name: Sync files (snapshot, safe)
|
||||||
run: |
|
run: |
|
||||||
# Copy into public working tree and delete removed files
|
|
||||||
rsync -a --delete \
|
rsync -a --delete \
|
||||||
--exclude '.git' \
|
--exclude '.git' \
|
||||||
--exclude '.gitea' \
|
--exclude '.gitea' \
|
||||||
./ /tmp/public/
|
./ /tmp/public/
|
||||||
|
|
||||||
cd /tmp/public
|
cd /tmp/public
|
||||||
git config user.name "Gitea CI"
|
git config user.name "Gitea CI"
|
||||||
git config user.email "ci@bausager.org"
|
git config user.email "ci@bausager.org"
|
||||||
|
|
||||||
if ! git diff --quiet; then
|
if ! git diff --quiet; then
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "Sync from Flux (private)"
|
git commit -m "Sync from Flux (private)"
|
||||||
|
|||||||
Reference in New Issue
Block a user