Build gear loader #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build gear loader | |
on: | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
BINARYEN_VERSION: version_111 | |
jobs: | |
build-gear-loader: | |
runs-on: [kuberunner] | |
env: | |
RUSTUP_HOME: /tmp/rustup_home | |
steps: | |
- name: "ACTIONS: Checkout" | |
uses: actions/checkout@v3 | |
- name: "Install: Set cargo path" | |
run: echo "/tmp/cargo/bin" >> $GITHUB_PATH | |
- name: "Install: Rust toolchain" | |
uses: dsherret/rust-toolchain-file@v1 | |
- name: "Install: Build deps" | |
run: | | |
sudo apt update | |
sudo apt install -y git clang curl libssl-dev llvm libudev-dev cmake wabt protobuf-compiler wget bzip2 | |
sudo wget -c https://github.com/WebAssembly/binaryen/releases/download/$BINARYEN_VERSION/binaryen-$BINARYEN_VERSION-x86_64-linux.tar.gz -O - | sudo tar -xz -C . | |
sudo cp binaryen-$BINARYEN_VERSION/bin/wasm-opt /usr/bin/ | |
- name: "Build gear-loader" | |
run: | | |
cargo build --release --locked --package gear-node-loader | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gear-loader | |
path: | | |
target/release/gear-node-loader | |
update-gear-loader: | |
runs-on: ubuntu-latest | |
needs: build-gear-loader | |
steps: | |
- name: "ACTIONS: Checkout" | |
uses: actions/checkout@v3 | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: gear-loader | |
- name: Run playbook | |
uses: dawidd6/action-ansible-playbook@v2 | |
with: | |
directory: ./ansible/ | |
playbook: gear-loader-update.yaml | |
key: ${{secrets.SSH_PRIVATE_KEY}} | |
inventory: | | |
[all] | |
${{secrets.GEAR_LOADER_NODE}} |