Skip to content

fix program name in deploy event #97

fix program name in deploy event

fix program name in deploy event #97

Workflow file for this run

name: Build
on:
- push
- pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get install -y musl-tools
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- run: cargo build --release --target x86_64-unknown-linux-musl
- uses: actions/upload-artifact@v3
with:
name: lila-tablebase
path: target/x86_64-unknown-linux-musl/release/lila-tablebase
deploy:
runs-on: ubuntu-latest
environment:
name: terra
url: https://tablebase.lichess.ovh/monitor
concurrency:
group: terra
cancel-in-progress: true
needs: build
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/download-artifact@v3
with:
name: lila-tablebase
- name: Configure SSH
run: |
mkdir -p ~/.ssh
touch ~/.ssh/deploy.key
chmod 600 ~/.ssh/deploy.key
echo "$SSH_KEY" > ~/.ssh/deploy.key
cat >>~/.ssh/config <<END
Host deploy-host
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/deploy.key
StrictHostKeyChecking no
END
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
- name: Deploy via SSH
run: cat lila-tablebase | ssh deploy-host "mv /usr/local/bin/lila-tablebase /usr/local/bin/lila-tablebase.bak && cat - > /usr/local/bin/lila-tablebase && chmod +x /usr/local/bin/lila-tablebase && systemctl restart lila-tablebase"
if: always()