-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (68 loc) · 3.02 KB
/
build.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
name: Build and publish Mina lightweight network Docker images
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch: {}
jobs:
build-and-publish:
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
- name: Install and cache Hetzner Cloud CLI
uses: 3bit/setup-hcloud@v2
- name: Create mina-build-system cloud VM
run: hcloud server create --name mina-build-system --datacenter fsn1-dc14 --primary-ipv4 35577977 --image 121535411 --type cpx31 --ssh-key app@localhost --start-after-create
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 120 seconds
run: sleep 120s
shell: bash
- name: Update remote repository
uses: appleboy/[email protected]
with:
host: ${{ secrets.MINA_BUILD_SYSTEM_IP }}
username: ${{ secrets.MINA_BUILD_SYSTEM_SSH_USER_NAME }}
key: ${{ secrets.MINA_BUILD_SYSTEM_SSH_PRIVATE_KEY }}
script: bash -ilc "cd ${HOME}/projects/o1labs/mina-lightnet-docker && git stash && git pull && git reset && git clean -f && git checkout . && git submodule sync && git submodule update --recursive --init"
command_timeout: 170m
- name: Update GoEnv
uses: appleboy/[email protected]
with:
host: ${{ secrets.MINA_BUILD_SYSTEM_IP }}
username: ${{ secrets.MINA_BUILD_SYSTEM_SSH_USER_NAME }}
key: ${{ secrets.MINA_BUILD_SYSTEM_SSH_PRIVATE_KEY }}
script: bash -ilc "cd ${HOME}/.goenv && git fetch --all && git pull"
command_timeout: 170m
- name: Install Go 1.19.12
uses: appleboy/[email protected]
with:
host: ${{ secrets.MINA_BUILD_SYSTEM_IP }}
username: ${{ secrets.MINA_BUILD_SYSTEM_SSH_USER_NAME }}
key: ${{ secrets.MINA_BUILD_SYSTEM_SSH_PRIVATE_KEY }}
script: bash -ilc "goenv install --skip-existing 1.19.12 && goenv global 1.19.12"
command_timeout: 170m
- name: Build and publish Docker images (major branches)
uses: appleboy/[email protected]
with:
host: ${{ secrets.MINA_BUILD_SYSTEM_IP }}
username: ${{ secrets.MINA_BUILD_SYSTEM_SSH_USER_NAME }}
key: ${{ secrets.MINA_BUILD_SYSTEM_SSH_PRIVATE_KEY }}
script: bash -ilc "${HOME}/projects/o1labs/mina-lightnet-docker/scripts/build-all.sh ${HOME}/projects/o1labs/mina ${HOME}/projects/o1labs/mina-lightnet-docker ${HOME}/projects/p42/mina-accounts-manager o1labs \"develop berkeley rampup\""
command_timeout: 170m
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash
- name: Power off the VM
run: hcloud server poweroff mina-build-system
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash
- name: Delete the VM
run: hcloud server delete mina-build-system
env:
HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }}
- name: Sleep for 15 seconds
run: sleep 15s
shell: bash