modified: .gitea/workflows/deploy.yml
This commit is contained in:
@@ -11,27 +11,35 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Deploy to shared pages volume
|
||||
- name: Deploy to shared pages volume (tar stream, no bind mounts)
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
# Gitea/Actions exposes GitHub-compatible env var:
|
||||
# GITHUB_REPOSITORY = "Owner/Repo"
|
||||
OWNER="$(echo "${GITHUB_REPOSITORY}" | cut -d/ -f1)"
|
||||
REPO="$(echo "${GITHUB_REPOSITORY}" | cut -d/ -f2)"
|
||||
|
||||
TARGET="/target/${OWNER}/${REPO}"
|
||||
|
||||
echo "Deploying ${GITHUB_REPOSITORY} -> ${TARGET}"
|
||||
echo "Using docker volume: gitea_pages_root"
|
||||
echo "Files in repo root:"
|
||||
ls -la
|
||||
|
||||
# Create a tar stream of the repo content (excluding VCS + workflow folder)
|
||||
# and extract it directly into the docker volume via stdin.
|
||||
tar -czf - \
|
||||
--exclude=".git" \
|
||||
--exclude=".gitea" \
|
||||
. \
|
||||
| docker run --rm -i \
|
||||
-v gitea_pages_root:/target \
|
||||
alpine:3.20 sh -lc '
|
||||
set -e
|
||||
mkdir -p "'"$TARGET"'"
|
||||
rm -rf "'"$TARGET"'/"* "'"$TARGET"'/"..* 2>/dev/null || true
|
||||
tar -xzf - -C "'"$TARGET"'"
|
||||
'
|
||||
|
||||
echo "Deployed. Listing target:"
|
||||
docker run --rm \
|
||||
-v gitea_pages_root:/target \
|
||||
-v "$PWD":/src \
|
||||
alpine:3.20 sh -lc '
|
||||
apk add --no-cache rsync >/dev/null
|
||||
mkdir -p "'"$TARGET"'"
|
||||
rsync -av --delete /src/ "'"$TARGET"'"/ \
|
||||
--exclude ".git" \
|
||||
--exclude ".gitea"
|
||||
'
|
||||
alpine:3.20 sh -lc 'ls -la "'"$TARGET"'" | sed -n "1,50p"'
|
||||
|
||||
Reference in New Issue
Block a user