Merge branch 'main' into mainnet #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deployment Prod | |
on: | |
push: | |
branches: | |
- mainnet | |
jobs: | |
build-and-deploy: | |
name: Build and Deployment | |
runs-on: ubuntu-20.04 | |
permissions: | |
packages: write | |
contents: read | |
attestations: write | |
steps: | |
# Deploy to Server | |
- name: SSH & Deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.MAINNET_FRONTEND_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.FRONTEND_SSH_KEY }} | |
script: | | |
#!/usr/bin/env bash | |
cd Hub | |
sudo git checkout mainnet; | |
sudo git pull origin mainnet; | |
echo "Stopping and removing specific service: hub_mainnet" | |
sudo docker-compose stop hub_mainnet | |
sudo docker-compose rm -f hub_mainnet | |
echo "Removing dangling images" | |
sudo docker rmi $(sudo docker images -f "dangling=true" -q) || true | |
sudo docker build -t autlabs/hub:mainnet . --build-arg ENV_FILE=.env_prod | |
# sudo docker push autlabs/hub:mainnet | |
echo "Pulling the new image" | |
# sudo docker-compose pull hub_mainnet | |
docker-compose up -d --build hub_mainnet | |
exit 0; |