-
Notifications
You must be signed in to change notification settings - Fork 18
73 lines (62 loc) · 4.33 KB
/
deploy-main-on-staging.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# 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"
host_keys: | # Use `ssh-keyscan -H host` to obtain the host keys
|1|orGVLr9O7BxtBi/Z7x7IUNDCHqQ=|1dGYJsc6Qrz09BDzpdNGPKb3DKM= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDvpJciWglq3BlK1clNRcDNuPxUBxawlNjTIGdUv2j2MZ8+9bUZCJB5iqH+3onG9VIekTPumrlYWlS/fI/K37u8yQrnCrd6/WFoWYbNi2x5lR9Hsi5bEt80P0FArUZZJGsntPuXFxRFGwGxSD53vzeLne8V4eiLkCpc059c6UTpnnW/J7QFyseDCQr0W1l30Mr9gNmKnjAweKYwBKHXhn6TgRwTXOQ7UrBsw6CWt8r67h8BBvPt99ky8yxuL6gnSFXjyhr+5awYScuaUNIKptcbE9jHHxDcQKHstjFYDtl3BV7okPI/QbZnZR05St8/fWh+jy+vmGpSZkErBv6E0tXG08fvGayTW5aUqlQBiK32i6beQj+v27oJTZworwA9RBcT+jiBYTMUAiM2knXW0ijOebX3ZrJHNnPmrdn0SwRetiKG86HgQ+wwkGpwu1VM5y1em5pgETvu9Hx5E1JxBKqrwfGaMUQXVDXo2489mmWg05iAGz6HisSUdDHYQ+8gZp8=
|1|oS92sSDotqSXRoAz1JEKUvD8ULc=|5mHvAIWjnMB7b0rYQBZ4IpihYjA= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFMjvE8AlBf1nJucFehBcIF6DO0tbNuOz8LyBQTt/6FQ0if2YP1ABuN0fauHOtxXLzonoHeaL6ZWBhjHfDex6V8=
|1|LsiOstaTi9lHXJQlX2XCw7CISSY=|i5G9ELrrtzZbE+GbcmauH218mY4= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJuASD1f5wgW3zgwqFjPWc8OF/AgZfHQUkyQ016sS+Fj
os: "debian-12"
make_target: "all-podman-debian-12"
artifact_name: "aleph-vm.debian-12.deb"
- hostname: "hetzner.staging.aleph.sh"
host_keys: |
|1|rq5/ijUdR9RR/2hUJxY6e+WxgYM=|HHkM5wCi0e1tLd/YAvB1fhRx6ZA= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDvpJciWglq3BlK1clNRcDNuPxUBxawlNjTIGdUv2j2MZ8+9bUZCJB5iqH+3onG9VIekTPumrlYWlS/fI/K37u8yQrnCrd6/WFoWYbNi2x5lR9Hsi5bEt80P0FArUZZJGsntPuXFxRFGwGxSD53vzeLne8V4eiLkCpc059c6UTpnnW/J7QFyseDCQr0W1l30Mr9gNmKnjAweKYwBKHXhn6TgRwTXOQ7UrBsw6CWt8r67h8BBvPt99ky8yxuL6gnSFXjyhr+5awYScuaUNIKptcbE9jHHxDcQKHstjFYDtl3BV7okPI/QbZnZR05St8/fWh+jy+vmGpSZkErBv6E0tXG08fvGayTW5aUqlQBiK32i6beQj+v27oJTZworwA9RBcT+jiBYTMUAiM2knXW0ijOebX3ZrJHNnPmrdn0SwRetiKG86HgQ+wwkGpwu1VM5y1em5pgETvu9Hx5E1JxBKqrwfGaMUQXVDXo2489mmWg05iAGz6HisSUdDHYQ+8gZp8=
|1|0NHnYZBjWoH9wGUXB4qD7x/iv68=|OvNcRso1gawWuXoDk567eK9pQ1A= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFMjvE8AlBf1nJucFehBcIF6DO0tbNuOz8LyBQTt/6FQ0if2YP1ABuN0fauHOtxXLzonoHeaL6ZWBhjHfDex6V8=
|1|V0i9hIon1ao2vVMpdCg64IKzWjY=|lQrPhlTT2XAhyuUprAFm+Gu52XI= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJuASD1f5wgW3zgwqFjPWc8OF/AgZfHQUkyQ016sS+Fj
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 }} > ~/.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 }}"
# Allow some time for IPFS Kubo to start
sleep 5