Skip to content

fixup! Fix: Branch main could not be tested easily #4

fixup! Fix: Branch main could not be tested easily

fixup! Fix: Branch main could not be tested easily #4

# This workflow automatically deploys main on staging
name: "Deploy `main` automatically on staging"
on:
push:
# branches:
# - main
jobs:
deploy_staging_servers:
name: "Deploying on ${{ matrix.staging_servers.hostname }}"
runs-on: ubuntu-latest
strategy:
matrix:
staging_servers:
- hostname: "ovh.staging.aleph.sh"
# Use `ssh-keyscan -H host | base64 --wrap=0` to obtain the host keys
host_keys: "fDF8b3JHVkxyOU83Qnh0QmkvWjd4N0lVTkRDSHFRPXwxZEdZSnNjNlFyejA5QkR6cGROR1BLYjNES009IHNzaC1yc2EgQUFBQUIzTnphQzF5YzJFQUFBQURBUUFCQUFBQmdRRHZwSmNpV2dscTNCbEsxY2xOUmNETnVQeFVCeGF3bE5qVElHZFV2MmoyTVo4KzliVVpDSkI1aXFIKzNvbkc5Vklla1RQdW1ybFlXbFMvZkkvSzM3dTh5UXJuQ3JkNi9XRm9XWWJOaTJ4NWxSOUhzaTViRXQ4MFAwRkFyVVpaSkdzbnRQdVhGeFJGR3dHeFNENTN2emVMbmU4VjRlaUxrQ3BjMDU5YzZVVHBublcvSjdRRnlzZURDUXIwVzFsMzBNcjlnTm1LbmpBd2VLWXdCS0hYaG42VGdSd1RYT1E3VXJCc3c2Q1d0OHI2N2g4QkJ2UHQ5OWt5OHl4dUw2Z25TRlhqeWhyKzVhd1lTY3VhVU5JS3B0Y2JFOWpISHhEY1FLSHN0akZZRHRsM0JWN29rUEkvUWJablpSMDVTdDgvZldoK2p5K3ZtR3BTWmtFckJ2NkUwdFhHMDhmdkdheVRXNWFVcWxRQmlLMzJpNmJlUWordjI3b0pUWndvcndBOVJCY1QramlCWVRNVUFpTTJrblhXMGlqT2ViWDNackpITm5QbXJkbjBTd1JldGlLRzg2SGdRK3d3a0dwd3UxVk01eTFlbTVwZ0VUdnU5SHg1RTFKeEJLcXJ3ZkdhTVVRWFZEWG8yNDg5bW1XZzA1aUFHejZIaXNTVWRESFlRKzhnWnA4PQp8MXxvUzkyc1NEb3RxU1hSb0F6MUpFS1V2RDhVTGM9fDVtSHZBSVdqbk1CN2IwcllRQlo0SXBpaFlqQT0gZWNkc2Etc2hhMi1uaXN0cDI1NiBBQUFBRTJWalpITmhMWE5vWVRJdGJtbHpkSEF5TlRZQUFBQUlibWx6ZEhBeU5UWUFBQUJCQkZNanZFOEFsQmYxbkp1Y0ZlaEJjSUY2RE8wdGJOdU96OEx5QlFUdC82RlEwaWYyWVAxQUJ1TjBmYXVIT3R4WEx6b25vSGVhTDZaV0JoakhmRGV4NlY4PQp8MXxMc2lPc3RhVGk5bEhYSlFsWDJYQ3c3Q0lTU1k9fGk1RzlFTHJydHpaYkUrR2JjbWF1SDIxOG1ZND0gc3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUp1QVNEMWY1d2dXM3pnd3FGalBXYzhPRi9BZ1pmSFFVa3lRMDE2c1MrRmoK"
os: "debian-12"
make_target: "all-podman-debian-12"
artifact_name: "aleph-vm.debian-12.deb"
- hostname: "hetzner.staging.aleph.sh"
# Use `ssh-keyscan -H host | base64 --wrap=0` to obtain the host keys
host_keys: "fDF8cnE1L2lqVWRSOVJSLzJoVUp4WTZlK1d4Z1lNPXxISGtNNXdDaTBlMXRMZC9ZQXZCMWZoUng2WkE9IHNzaC1yc2EgQUFBQUIzTnphQzF5YzJFQUFBQURBUUFCQUFBQmdRRHZwSmNpV2dscTNCbEsxY2xOUmNETnVQeFVCeGF3bE5qVElHZFV2MmoyTVo4KzliVVpDSkI1aXFIKzNvbkc5Vklla1RQdW1ybFlXbFMvZkkvSzM3dTh5UXJuQ3JkNi9XRm9XWWJOaTJ4NWxSOUhzaTViRXQ4MFAwRkFyVVpaSkdzbnRQdVhGeFJGR3dHeFNENTN2emVMbmU4VjRlaUxrQ3BjMDU5YzZVVHBublcvSjdRRnlzZURDUXIwVzFsMzBNcjlnTm1LbmpBd2VLWXdCS0hYaG42VGdSd1RYT1E3VXJCc3c2Q1d0OHI2N2g4QkJ2UHQ5OWt5OHl4dUw2Z25TRlhqeWhyKzVhd1lTY3VhVU5JS3B0Y2JFOWpISHhEY1FLSHN0akZZRHRsM0JWN29rUEkvUWJablpSMDVTdDgvZldoK2p5K3ZtR3BTWmtFckJ2NkUwdFhHMDhmdkdheVRXNWFVcWxRQmlLMzJpNmJlUWordjI3b0pUWndvcndBOVJCY1QramlCWVRNVUFpTTJrblhXMGlqT2ViWDNackpITm5QbXJkbjBTd1JldGlLRzg2SGdRK3d3a0dwd3UxVk01eTFlbTVwZ0VUdnU5SHg1RTFKeEJLcXJ3ZkdhTVVRWFZEWG8yNDg5bW1XZzA1aUFHejZIaXNTVWRESFlRKzhnWnA4PQp8MXwwTkhuWVpCaldvSDl3R1VYQjRxRDd4L2l2Njg9fE92TmNSc28xZ2F3V3VYb0RrNTY3ZUs5cFExQT0gZWNkc2Etc2hhMi1uaXN0cDI1NiBBQUFBRTJWalpITmhMWE5vWVRJdGJtbHpkSEF5TlRZQUFBQUlibWx6ZEhBeU5UWUFBQUJCQkZNanZFOEFsQmYxbkp1Y0ZlaEJjSUY2RE8wdGJOdU96OEx5QlFUdC82RlEwaWYyWVAxQUJ1TjBmYXVIT3R4WEx6b25vSGVhTDZaV0JoakhmRGV4NlY4PQp8MXxWMGk5aElvbjFhbzJ2Vk1wZENnNjRJS3pXalk9fGxRclBobFRUMlhBaHl1VXByQUZtK0d1NTJYST0gc3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUp1QVNEMWY1d2dXM3pnd3FGalBXYzhPRi9BZ1pmSFFVa3lRMDE2c1MrRmoK"
os: "debian-12"
make_target: "all-podman-debian-12"
artifact_name: "aleph-vm.debian-12.deb"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Fetch the whole history for all tags and branches (required for aleph.__version__)
fetch-depth: 0
- run: |
cd packaging && make ${{ matrix.staging_servers.make_target }} && cd ..
ls packaging/target
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.staging_servers.artifact_name }}
path: packaging/target/${{ matrix.staging_servers.artifact_name }}
- name: Setup SSH private key
run: |
mkdir ~/.ssh
echo $STAGING_SSH_PRIVATE_KEY | base64 --decode > ~/.ssh/id_ed25519
chmod 0700 ~/.ssh
chmod 0600 ~/.ssh/id_ed25519
env:
# Create using:
# ssh-keygen -t ed25519 -f ./id_ed25519
# cat ./id_ed25519 | base64 --wrap=0
STAGING_SSH_PRIVATE_KEY: ${{ secrets.STAGING_SSH_PRIVATE_KEY }}
- name: Install Aleph-VM on the Staging servers
run: |
echo ${{ matrix.staging_servers.host_keys }} | base64 --decode > ~/.ssh/known_hosts
# Wait for /var/lib/apt/lists/lock to be unlocked on the remote host via SSH.
while ssh root@${SERVER_IPV4} lsof /var/lib/apt/lists/lock; do sleep 1; done
scp packaging/target/${{ matrix.staging_servers.package_name }} root@${SERVER_IPV4}:/opt
ssh root@${SERVER_IPV4} DEBIAN_FRONTEND=noninteractive "apt-get -o DPkg::Lock::Timeout=60 install -y /opt/${{ matrix.staging_servers.package_name }}"