Skip to content

Deploy Devnet

Deploy Devnet #8

Workflow file for this run

name: Deploy Devnet
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system deps
run: sudo apt-get install jq gettext
- name: Set up SSH
run: |
mkdir -p ~/.ssh/
touch ~/.ssh/known_hosts
ssh-keyscan ${{ secrets.DEVNET_HOST }} >> ~/.ssh/known_hosts
echo "${{ secrets.DEVNET_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
eval $(ssh-agent)
# - name: Authenticate GitHub CLI and download latest release of chainspec
# run: |
# gh auth login --with-token <<< "${{ secrets.ACCESS_TOKEN }}"
# LATEST_RELEASE=$(gh release list --repo Atleta-network/atleta --json tagName,createdAt --jq '.[] | select(.tagName | startswith("devnet-chainspec")) | .tagName' | sort -r | head -n 1)
# echo "${LATEST_RELEASE}"
# gh release download "${LATEST_RELEASE}" --repo Atleta-network/atleta --pattern "chain-spec.devnet.json" --dir chainspecs
- name: Download chainspec
run: |
mkdir chainspecs
wget -O chainspecs/chain-spec.devnet.json https://raw.githubusercontent.com/Atleta-network/atleta/refs/heads/devnet/chainspecs/chain-spec.devnet.json
- name: Copy Files to Server
run: |
scp devnet/docker-compose.yml ${{ secrets.DEVNET_USERNAME }}@${{ secrets.DEVNET_HOST }}:/sportchain/docker-compose.yml
scp chainspecs/chain-spec.devnet.json ${{ secrets.DEVNET_USERNAME }}@${{ secrets.DEVNET_HOST }}:/sportchain/chainspec.json
ssh -o StrictHostKeyChecking=no ${{ secrets.DEVNET_USERNAME }}@${{ secrets.DEVNET_HOST }} "mkdir -p /sportchain/process-exporter"
scp utils/telemetry/process-exporter/process-exporter.yml ${{ secrets.DEVNET_USERNAME }}@${{ secrets.DEVNET_HOST }}:/sportchain/process-exporter/process-exporter.yml
- name: SSH into Server and Deploy
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.DEVNET_HOST }}
username: ${{ secrets.DEVNET_USERNAME }}
key: ${{ secrets.DEVNET_PRIVATE_KEY }}
script: |
cd /sportchain
docker compose down
docker compose pull
docker compose up --detach