alice-meta-template/.gitea/workflows/deploy.yml

38 lines
1.4 KiB
YAML
Raw Normal View History

2024-09-09 10:44:58 -03:00
name: Deploy Package
run-name: ${{ gitea.actor }} is deploying
on: [push]
jobs:
Explore-Gitea-Actions:
2024-09-09 11:47:29 -03:00
runs-on: ubuntu-latest
2024-09-09 10:44:58 -03:00
steps:
- name: Deploy to alice
run: |
echo "${{ secrets.SCP_KEY_ALICE }}" > /tmp/ssh_private_key
chmod 600 /tmp/ssh_private_key
2024-09-09 11:25:54 -03:00
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:56:35 -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..."
rm -rf ./${{ github.event.repository.name }}/.git
echo "Building package..."
2024-09-09 11:47:29 -03:00
dpkg-deb --build ${{ github.event.repository.name }}
2024-09-09 19:56:35 -03:00
echo "Moving package to ppa..."
2024-09-09 11:47:29 -03:00
mv ${{ github.event.repository.name }}.deb /var/www/html/debian/pool/main
2024-09-09 11:25:54 -03:00
cd /var/www/html/debian
2024-09-09 19:56:35 -03:00
echo "Creating Packages file..."
2024-09-09 11:25:54 -03:00
dpkg-scanpackages pool/ > dists/stable/main/binary-amd64/Packages
2024-09-09 19:56:35 -03:00
echo "Creating Relase file..."
2024-09-09 11:25:54 -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
2024-09-09 11:47:29 -03:00
EOF