Skip to content

Commit

Permalink
Configure CD
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-tsurko committed Dec 11, 2023
1 parent dceaad9 commit a772ccf
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 17 deletions.
61 changes: 47 additions & 14 deletions .github/workflows/deploy-devnet.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,59 @@
name: Deploy devnet
name: Deploy Devnet

on:
push:
branches: [ "devnet" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install system deps
run: apt-get install protobuf-compiler
- name: Build
run: cargo build --verbose --locked
- name: Run tests
run: cargo test --verbose --locked
- name: Check format
run: cargo fmt -- --check
- name: Clippy checks
run: cargo clippy -- -D warnings

# - name: Create Image Tarball
# run: |
# docker build -t sportchain-node .
# docker save -o sportchain-node.tar sportchain-node
# mkdir -p artifacts
# mv sportchain-node.tar artifacts/

# - name: Set up SSH
# uses: webfactory/[email protected]
# with:
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Set up SSH
run: |
mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts
ssh-keyscan ${{ secrets.DEVNET_HOST }} >> ~/.ssh/known_hosts
eval $(ssh-agent)
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
- name: Copy Files to Server
run: |
# scp -r artifacts/* ${{ secrets.DEVNET_USERNAME}}@${{ secrets.DEVNET_HOST }}:/sportchain/
scp deploy/docker-compose.devnet.yml ${{ secrets.DEVNET_USERNAME}}@${{ secrets.DEVNET_HOST }}:/sportchain/docker-compose.yml
# - name: Copy Files to Server
# env:
# DEVNET_HOST: ${{ secrets.DEVNET_HOST }}
# DEVNET_USERNAME: ${{ secrets.DEVNET_USERNAME }}
# run: |
# scp -r artifacts/* "$DEVNET_USERNAME"@"$DEVNET_HOST":/sportchain/
# scp deploy/docker-compose.devnet.yml "$DEVNET_USERNAME"@"$DEVNET_HOST":/sportchain/docker-compose.yml
#
# - name: SSH into Server and Deploy
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.DEVNET_HOST }}
# username: ${{ secrets.DEVNET_USERNAME }}
# key: ${{ secrets.SSH_PRIVATE_KEY }}
# script: |
# cd /sportchain
# docker load -i sportchain-node.tar
# docker-compose down
# docker-compose pull
# docker-compose up -d --build --remove-orphans
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ version: "3"

services:
archive_node:
build:
context: ..
dockerfile: Dockerfile
image: sportchain-node
container_name: sportchain-archive-node
restart: always
Expand Down

0 comments on commit a772ccf

Please sign in to comment.