Updated README with CI/CD instructions included #6
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: Deploy the pre-prod branch code to an Azure Virtual Machine | |
on: | |
push: | |
branches: [ pre-prod ] | |
jobs: | |
deployment: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Copy files using SCP | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.PANKB_PREPROD_HOST }} | |
username: ${{ secrets.PANKB_PREPROD_SSH_USERNAME }} | |
key: ${{ secrets.PANKB_PREPROD_PRIVATE_SSH_KEY }} | |
source: "." | |
target: "/projects/pankb_web/pankb_llm" | |
- name: Create the .env file and (re-)start containers over SSH | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.PANKB_PREPROD_HOST }} | |
username: ${{ secrets.PANKB_PREPROD_SSH_USERNAME }} | |
key: ${{ secrets.PANKB_PREPROD_PRIVATE_SSH_KEY }} | |
port: 22 | |
script: | | |
cd /projects/pankb_web/pankb_llm | |
touch .env | |
echo "## Do not put this file under version control!" > .env | |
echo "" >> .env | |
echo OPENAI_API_KEY="${{secrets.OPENAI_API_KEY}}" >> .env | |
echo COHERE_API_KEY="${{secrets.COHERE_API_KEY}}" >> .env | |
echo TOGETHER_API_KEY="${{secrets.TOGETHER_API_KEY}}" >> .env | |
echo GOOGLE_API_KEY="${{secrets.GOOGLE_API_KEY}}" >> .env | |
echo ANTHROPIC_API_KEY="${{secrets.ANTHROPIC_API_KEY}}" >> .env | |
echo REPLICATE_API_TOKEN="${{secrets.REPLICATE_API_TOKEN}}" >> .env | |
echo VOYAGE_API_KEY="${{secrets.VOYAGE_API_KEY}}" >> .env | |
echo "" >> .env | |
echo "## MongoDB-PREPROD (Azure CosmosDB for MongoDB) Connection String" >> .env | |
echo "# Had to multiply maxIdleTimeMS by 10 to handle" >> .env | |
echo "# urllib3.exceptions.ProtocolError: (\"Connection broken: ConnectionResetError(104, 'Connection reset by peer')\", ConnectionResetError(104, 'Connection reset by peer'))" >> .env | |
echo MONGODB_CONN_STRING="${{secrets.PANKB_PREPROD_MONGODB_CONN_STRING}}" >> .env | |
cat .env | |
docker compose up -d --build --force-recreate |