alice-full/.gitea/workflows/deploy.yml

39 lines
1.5 KiB
YAML
Raw Normal View History

2024-09-09 15:33:53 -03:00
name: Deploy Package
run-name: ${{ gitea.actor }} is deploying
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- name: Deploy to alice
run: |
echo "${{ secrets.SCP_KEY_ALICE }}" > /tmp/ssh_private_key
chmod 600 /tmp/ssh_private_key
ssh -o "StrictHostKeyChecking no" -i /tmp/ssh_private_key act_runner@alice.ufsj.edu.br -p ${{ secrets.SSH_PORT_ALICE }} << 'EOF'
2024-09-09 19:54:43 -03:00
cd /tmp
echo "Removing old clones..."
rm -rf ./${{ github.event.repository.name }}
echo "Cloning the repo..."
git clone --depth=1 https://git.alice.ufsj.edu.br/${{ gitea.repository }}
echo "Removing .git dir..."
2024-09-09 20:25:42 -03:00
rm -rf ./${{ github.event.repository.name }}/.git ./${{ github.event.repository.name }}/.gitea
ls -la ./${{ github.event.repository.name }}
2024-09-09 19:54:43 -03:00
echo "Building package..."
2024-09-09 15:33:53 -03:00
dpkg-deb --build ${{ github.event.repository.name }}
2024-09-09 19:54:43 -03:00
echo "Moving package to ppa..."
2024-09-09 15:33:53 -03:00
mv ${{ github.event.repository.name }}.deb /var/www/html/debian/pool/main
cd /var/www/html/debian
2024-09-09 19:54:43 -03:00
echo "Creating Packages file..."
2024-09-09 15:33:53 -03:00
dpkg-scanpackages pool/ > dists/stable/main/binary-amd64/Packages
2024-09-09 19:54:43 -03:00
echo "Creating Relase file..."
2024-09-09 15:33:53 -03:00
apt-ftparchive -c /var/www/html/debian/apt-ftparchive.conf release /var/www/html/debian/dists/stable > /var/www/html/debian/dists/stable/Release
EOF