forked from polkadot-js/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.37 KB
/
deploy-atleta.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Deploy Explorer
on:
push:
branches: [ "atleta" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Create Image Tarball for Explorer
run: |
docker build -t sportchain-explorer -f docker/Dockerfile .
docker save -o sportchain-explorer.tar sportchain-explorer
mkdir -p artifacts/
mv sportchain-explorer.tar artifacts/
- name: Set up SSH
run: |
mkdir -p ~/.ssh/
touch ~/.ssh/known_hosts
ssh-keyscan ${{ secrets.EXPLORER_HOST }} >> ~/.ssh/known_hosts
echo "${{ secrets.EXPLORER_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
eval $(ssh-agent)
- name: Copy Files to Server
run: |
scp artifacts/sportchain-explorer.tar ${{ secrets.EXPLORER_USERNAME}}@${{ secrets.EXPLORER_HOST }}:/sportchain/
scp docker/docker-compose.yml ${{ secrets.EXPLORER_USERNAME}}@${{ secrets.EXPLORER_HOST }}:/sportchain/docker-compose.yml
- name: SSH into Server and Deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.EXPLORER_HOST }}
username: ${{ secrets.EXPLORER_USERNAME }}
key: ${{ secrets.EXPLORER_PRIVATE_KEY }}
script: |
cd /sportchain
docker load -i sportchain-explorer.tar
docker compose up -d