Skip to content

Merge pull request #86 from AI4WA/doc #34

Merge pull request #86 from AI4WA/doc

Merge pull request #86 from AI4WA/doc #34

Workflow file for this run

name: Deployment
on:
push:
branches:
- develop
jobs:
Deploy_API:
name: Deploy API
runs-on: ubuntu-latest
steps:
- name: Package the API codebase
uses: actions/checkout@v1
- name: Zip the whole codebase
run: |
ls -la
tar -cvf omni.tar .
- name: copy file via ssh password
uses: appleboy/scp-action@master
with:
host: "139.180.183.219"
username: root
password: ${{ secrets.SERVER_PASSWORD }}
port: 22
source: "omni.tar"
target: "/root/"
- name: Setup AWS Credentials
uses: appleboy/ssh-action@master
with:
host: "139.180.183.219"
username: root
password: ${{ secrets.SERVER_PASSWORD }}
port: 22
script: |
cd /root
rm -rf omni
mkdir omni
tar xopf omni.tar -C omni
cd /root/omni/API
mkdir -p ./.aws
echo "[default]" > ./.aws/config
echo "region = us-west-2" >> ./.aws/config
echo "[default]" > ./.aws/credentials
echo "aws_access_key_id = ${{ secrets.AWS_ACCESS_KEY_ID }}" >> ./.aws/credentials
echo "aws_secret_access_key = ${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ./.aws/credentials
- name: Build and Restart backend
uses: appleboy/ssh-action@master
with:
host: "139.180.183.219"
username: root
password: ${{ secrets.SERVER_PASSWORD }}
port: 22
script: |
cd /root/omni/API
docker compose -f docker-compose.yml down
STORAGE_SOLUTION=api docker compose -f docker-compose.yml up --build -d