Skip to content

Display name fix

Display name fix #7

Workflow file for this run

# deploy-dev.yaml (DAPI)
name: Deploy to Development
on:
pull_request:
branches:
- main
jobs:
build-and-deploy:
name: Build and Deploy to DAPI
runs-on: ubuntu-latest
env:
SERVER_USER: w3reg
SERVER_HOST: 135.181.202.179
SERVER_PORT: 22
DEPLOY_PATH: /home/w3reg/dapi.w3reg.org
SERVICE_NAME: w3registrar-dapi
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
protobuf-compiler \
rsync \
cmake \
pkg-config \
clang \
llvm
- name: Build binary
run: |
cargo build --release --target x86_64-unknown-linux-gnu
ls -la target/x86_64-unknown-linux-gnu/release/
- name: Deploy binary to server
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -p ${{ env.SERVER_PORT }} ${{ env.SERVER_HOST }} >> ~/.ssh/known_hosts
rsync -avz -e "ssh -i ~/.ssh/id_ed25519 -p ${{ env.SERVER_PORT }}" \
target/x86_64-unknown-linux-gnu/release/w3registrar ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }}:${{ env.DEPLOY_PATH }}/${{ env.SERVICE_NAME }}
- name: Restart service
run: |
ssh -i ~/.ssh/id_ed25519 -p ${{ env.SERVER_PORT }} ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }} << EOF
mkdir -p ~/.config/systemd/user
systemctl --user daemon-reload
systemctl --user restart ${{ env.SERVICE_NAME }}
systemctl --user status ${{ env.SERVICE_NAME }} --no-pager
EOF