Skip to content

Optimize nginx reloading usage fix 3 #12

Optimize nginx reloading usage fix 3

Optimize nginx reloading usage fix 3 #12

Workflow file for this run

name: Deploy Explorer
on:
push:
branches: [ "devops/55-nginx-reloading" ]
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