Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b31ae72153 | |||
| 1db08b1e9b |
@@ -0,0 +1,12 @@
|
|||||||
|
# Files to exclude from GitHub mirror
|
||||||
|
.env* export-ignore
|
||||||
|
docker-compose.prod.yml export-ignore
|
||||||
|
.claudedocs/ export-ignore
|
||||||
|
backend/data/ export-ignore
|
||||||
|
backend/storage/ export-ignore
|
||||||
|
backend/.env* export-ignore
|
||||||
|
frontend/.env* export-ignore
|
||||||
|
secrets/ export-ignore
|
||||||
|
*.key export-ignore
|
||||||
|
*.pem export-ignore
|
||||||
|
.gitea/ export-ignore
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
name: Mirror to GitHub (Archive Method)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
mirror:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Mirror using git archive
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
# Configure git
|
||||||
|
git config --global user.name "Gitea Mirror Bot"
|
||||||
|
git config --global user.email "bot@noreply.gitea.local"
|
||||||
|
|
||||||
|
# Copy gitattributes
|
||||||
|
cp .gitattributes-github .gitattributes
|
||||||
|
|
||||||
|
# Create archive excluding files
|
||||||
|
git archive --format=tar HEAD | tar -x -C /tmp/export
|
||||||
|
|
||||||
|
# Initialize new repo in export directory
|
||||||
|
cd /tmp/export
|
||||||
|
git init
|
||||||
|
git add .
|
||||||
|
git commit -m "Mirror from Gitea: $(date '+%Y-%m-%d %H:%M:%S')"
|
||||||
|
|
||||||
|
# Push to GitHub
|
||||||
|
git remote add origin https://x-access-token:${GITHUB_TOKEN}@github.com/YOUR_GITHUB_USERNAME/YOUR_REPO_NAME.git
|
||||||
|
git push -f origin main
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
name: Mirror to GitHub (Rsync Method)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
mirror:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Prepare mirror directory
|
||||||
|
run: |
|
||||||
|
# Create mirror directory
|
||||||
|
mkdir -p /tmp/github-mirror
|
||||||
|
|
||||||
|
# Use rsync to copy files, excluding sensitive ones
|
||||||
|
rsync -av --exclude-from='.github-mirror-exclude' ./ /tmp/github-mirror/
|
||||||
|
|
||||||
|
- name: Push to GitHub
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
cd /tmp/github-mirror
|
||||||
|
|
||||||
|
# Initialize git repo
|
||||||
|
git init
|
||||||
|
git config user.name "Gitea Mirror Bot"
|
||||||
|
git config user.email "bot@noreply.gitea.local"
|
||||||
|
|
||||||
|
# Add all files and commit
|
||||||
|
git add .
|
||||||
|
git commit -m "Mirror from Gitea: $(git --git-dir=$GITHUB_WORKSPACE/.git log -1 --format='%h %s')"
|
||||||
|
|
||||||
|
# Push to GitHub
|
||||||
|
git remote add origin https://x-access-token:${GITHUB_TOKEN}@github.com/YOUR_GITHUB_USERNAME/YOUR_REPO_NAME.git
|
||||||
|
git push -f origin main
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
name: Mirror to GitHub
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
mirror:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Full history needed for mirroring
|
||||||
|
|
||||||
|
- name: Setup Git
|
||||||
|
run: |
|
||||||
|
git config --global user.name "Gitea Mirror Bot"
|
||||||
|
git config --global user.email "bot@noreply.gitea.local"
|
||||||
|
|
||||||
|
- name: Create filtered branch
|
||||||
|
run: |
|
||||||
|
# Create a new branch for GitHub
|
||||||
|
git checkout -b github-mirror
|
||||||
|
|
||||||
|
# Remove sensitive files/directories
|
||||||
|
# Example: Remove .env files, private configs, etc.
|
||||||
|
git rm -r --cached .env* || true
|
||||||
|
git rm -r --cached backend/.env* || true
|
||||||
|
git rm -r --cached frontend/.env* || true
|
||||||
|
git rm -r --cached docker-compose.prod.yml || true
|
||||||
|
git rm -r --cached .claudedocs/ || true
|
||||||
|
git rm -r --cached backend/data/ || true
|
||||||
|
git rm -r --cached backend/storage/ || true
|
||||||
|
|
||||||
|
# Commit the changes
|
||||||
|
git commit -m "Remove sensitive files for GitHub mirror" || true
|
||||||
|
|
||||||
|
- name: Push to GitHub
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
# Add GitHub remote
|
||||||
|
git remote add github https://x-access-token:${GITHUB_TOKEN}@github.com/YOUR_GITHUB_USERNAME/YOUR_REPO_NAME.git
|
||||||
|
|
||||||
|
# Force push the filtered branch to GitHub main
|
||||||
|
git push github github-mirror:main --force
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Exclude patterns for GitHub mirror
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
.env*
|
||||||
|
docker-compose.prod.yml
|
||||||
|
docker-compose.traefik.yml
|
||||||
|
.claudedocs/
|
||||||
|
backend/data/
|
||||||
|
backend/storage/
|
||||||
|
backend/.env*
|
||||||
|
frontend/.env*
|
||||||
|
secrets/
|
||||||
|
*.key
|
||||||
|
*.pem
|
||||||
|
.gitea/
|
||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
*.log
|
||||||
|
.DS_Store
|
||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "picpeak-backend",
|
"name": "picpeak-backend",
|
||||||
"version": "1.0.22",
|
"version": "1.0.23",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "picpeak-backend",
|
"name": "picpeak-backend",
|
||||||
"version": "1.0.22",
|
"version": "1.0.23",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"adm-zip": "^0.5.16",
|
"adm-zip": "^0.5.16",
|
||||||
"archiver": "^5.3.1",
|
"archiver": "^5.3.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "picpeak-backend",
|
"name": "picpeak-backend",
|
||||||
"version": "1.0.22",
|
"version": "1.0.23",
|
||||||
"description": "Backend for PicPeak event photo sharing platform",
|
"description": "Backend for PicPeak event photo sharing platform",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "picpeak-frontend",
|
"name": "picpeak-frontend",
|
||||||
"version": "1.0.22",
|
"version": "1.0.23",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "picpeak-frontend",
|
"name": "picpeak-frontend",
|
||||||
"version": "1.0.22",
|
"version": "1.0.23",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tanstack/react-query": "^5.0.0",
|
"@tanstack/react-query": "^5.0.0",
|
||||||
"@tiptap/extension-link": "^2.25.0",
|
"@tiptap/extension-link": "^2.25.0",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "picpeak-frontend",
|
"name": "picpeak-frontend",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.22",
|
"version": "1.0.23",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
Reference in New Issue
Block a user