Compare commits

..

No commits in common. "175f79e30392d55bdbd700f02dde8fc8d89ff132" and "0d28b08727791bb2a3cc19af14d99878ea1106d6" have entirely different histories.

4 changed files with 0 additions and 178 deletions

View File

@ -1,77 +0,0 @@
name: Deploy to Production Server
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set SSH key permissions
shell: bash
run: |
# Izpis trenutne delovne mape in seznama datotek
pwd
ls -la
# Uporabimo SSH ključ iz skrivnosti
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa_gitea
chmod 600 ~/.ssh/id_rsa_gitea
echo "SSH ključ ustvarjen iz skrivnosti"
- name: Install rsync
shell: bash
run: |
# Preverimo, ali lahko namestimo rsync
echo "Preverjanje možnosti namestitve rsync..."
if command -v apt-get &> /dev/null; then
echo "Poskušam namestiti rsync z apt-get..."
sudo apt-get update && sudo apt-get install -y rsync || echo "Ni mogoče namestiti rsync z apt-get"
elif command -v yum &> /dev/null; then
echo "Poskušam namestiti rsync z yum..."
sudo yum install -y rsync || echo "Ni mogoče namestiti rsync z yum"
else
echo "Ni mogoče namestiti rsync - manjka paketni upravljalnik"
fi
# Preverimo, ali je rsync nameščen
if command -v rsync &> /dev/null; then
echo "rsync je nameščen, verzija:"
rsync --version | head -n 1
else
echo "rsync ni nameščen, uporabili bomo tar"
fi
- name: Deploy to production server
shell: bash
run: |
SSH_KEY="~/.ssh/id_rsa_gitea"
echo "Uporabljam SSH ključ: $SSH_KEY"
# Testiranje SSH povezave
ssh -p 5050 -i "$SSH_KEY" -o StrictHostKeyChecking=no forexana@152.89.234.215 "echo 'SSH povezava uspešna'"
# Izbrišemo obstoječo vsebino v mapi vtičnika v produkcijskem okolju
ssh -p 5050 -i "$SSH_KEY" -o StrictHostKeyChecking=no forexana@152.89.234.215 "rm -rf public_html/wp-content/plugins/custom_wheel\ 2/*"
# Poskusimo najprej z rsync, če je nameščen
if command -v rsync &> /dev/null; then
echo "Prenašanje datotek z rsync..."
rsync -avz -e "ssh -p 5050 -i $SSH_KEY -o StrictHostKeyChecking=no" --exclude=".git" --exclude=".gitea" --exclude="id_rsa_gitea*" ./ forexana@152.89.234.215:public_html/wp-content/plugins/custom_wheel\ 2/
else
# Alternativna metoda prenosa z uporabo tar preko SSH
echo "Prenašanje datotek s tar preko SSH..."
tar czf - --exclude=".git" --exclude=".gitea" --exclude="id_rsa_gitea*" ./ | ssh -p 5050 -i "$SSH_KEY" -o StrictHostKeyChecking=no forexana@152.89.234.215 "tar xzf - -C public_html/wp-content/plugins/custom_wheel\ 2/"
fi
# Nastavimo pravilna dovoljenja
ssh -p 5050 -i "$SSH_KEY" -o StrictHostKeyChecking=no forexana@152.89.234.215 "chmod -R 755 public_html/wp-content/plugins/custom_wheel\ 2/"
echo "Production deployment completed successfully!"

View File

@ -1,93 +0,0 @@
name: Deploy to Test Server
on:
push:
branches:
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set SSH key permissions
shell: bash
run: |
# Izpis trenutne delovne mape in seznama datotek
pwd
ls -la
ls -la .gitea/runner/ || echo "Mapa runner ne obstaja"
# Poskusimo najti SSH ključ
find . -name "id_rsa_gitea*" -type f
# Uporabimo SSH ključ v bazi repozitorija
if [ -f ".gitea/runner/id_rsa_gitea" ]; then
chmod 600 .gitea/runner/id_rsa_gitea
echo "SSH ključ najden in nastavljen"
else
echo "SSH ključ ni bil najden na pričakovani lokaciji!"
# Ustvarimo SSH ključ iz kodiranega besedila
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa_gitea
chmod 600 ~/.ssh/id_rsa_gitea
echo "SSH ključ ustvarjen iz skrivnosti"
fi
- name: Install rsync
shell: bash
run: |
# Preverimo, ali lahko namestimo rsync
echo "Preverjanje možnosti namestitve rsync..."
if command -v apt-get &> /dev/null; then
echo "Poskušam namestiti rsync z apt-get..."
sudo apt-get update && sudo apt-get install -y rsync || echo "Ni mogoče namestiti rsync z apt-get"
elif command -v yum &> /dev/null; then
echo "Poskušam namestiti rsync z yum..."
sudo yum install -y rsync || echo "Ni mogoče namestiti rsync z yum"
else
echo "Ni mogoče namestiti rsync - manjka paketni upravljalnik"
fi
# Preverimo, ali je rsync nameščen
if command -v rsync &> /dev/null; then
echo "rsync je nameščen, verzija:"
rsync --version | head -n 1
else
echo "rsync ni nameščen, uporabili bomo tar"
fi
- name: Deploy to test server
shell: bash
run: |
# Najprej preverimo SSH povezavo
if [ -f ".gitea/runner/id_rsa_gitea" ]; then
SSH_KEY=".gitea/runner/id_rsa_gitea"
else
SSH_KEY="~/.ssh/id_rsa_gitea"
fi
echo "Uporabljam SSH ključ: $SSH_KEY"
# Testiranje SSH povezave
ssh -p 5050 -i "$SSH_KEY" -o StrictHostKeyChecking=no forexana@152.89.234.215 "echo 'SSH povezava uspešna'"
# Izbrišemo obstoječo vsebino v mapi vtičnika
ssh -p 5050 -i "$SSH_KEY" -o StrictHostKeyChecking=no forexana@152.89.234.215 "rm -rf test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/*"
# Poskusimo najprej z rsync, če je nameščen
if command -v rsync &> /dev/null; then
echo "Prenašanje datotek z rsync..."
rsync -avz -e "ssh -p 5050 -i $SSH_KEY -o StrictHostKeyChecking=no" --exclude=".git" --exclude=".gitea" --exclude="id_rsa_gitea*" ./ forexana@152.89.234.215:test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/
else
# Alternativna metoda prenosa z uporabo tar preko SSH
echo "Prenašanje datotek s tar preko SSH..."
tar czf - --exclude=".git" --exclude=".gitea" --exclude="id_rsa_gitea*" ./ | ssh -p 5050 -i "$SSH_KEY" -o StrictHostKeyChecking=no forexana@152.89.234.215 "tar xzf - -C test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/"
fi
# Nastavimo pravilna dovoljenja
ssh -p 5050 -i "$SSH_KEY" -o StrictHostKeyChecking=no forexana@152.89.234.215 "chmod -R 755 test.forexanalysis.com/wp-content/plugins/custom_wheel\ 2/"
echo "Deployment completed successfully!"

4
.gitignore vendored
View File

@ -13,10 +13,6 @@ Thumbs.db
*.sublime-project *.sublime-project
*.sublime-workspace *.sublime-workspace
# SSH ključi
id_rsa_*
.gitea/runner/id_rsa_*
# WordPress specific files # WordPress specific files
*.log *.log
wp-config.php wp-config.php

View File

@ -1,7 +1,3 @@
# Wheel of Fortune Plugin
Test posodobitve za preverjanje Gitea workflow.
# Wheel of Fortune - WordPress Plugin # Wheel of Fortune - WordPress Plugin
Vtičnik "Kolo Sreče" (Wheel of Fortune) omogoča uporabnikom vrtenje kolesa za nagrade. Povezan je z WooCommerce za dodeljevanje spinov ob nakupu izdelkov. Vtičnik "Kolo Sreče" (Wheel of Fortune) omogoča uporabnikom vrtenje kolesa za nagrade. Povezan je z WooCommerce za dodeljevanje spinov ob nakupu izdelkov.