CI/CD
This commit is contained in:
+44
-24
@@ -73,31 +73,51 @@ jobs:
|
||||
run: |
|
||||
git clone http://gitea:3000/sajad-dev/Ai.git .
|
||||
|
||||
- name: Install Python
|
||||
run: |
|
||||
apt-get install -y python3 python3-pip python3-venv git
|
||||
# - name: Install Python
|
||||
# run: |
|
||||
# apt-get install -y python3 python3-pip python3-venv git
|
||||
|
||||
- name: Setup Python pip mirrors
|
||||
run: |
|
||||
pip3 config --user set global.index-url https://package-mirror.liara.ir/repository/pypi/simple
|
||||
pip3 config --user set global.extra-index-url https://mirror.cdn.ir/repository/pypi/simple
|
||||
pip3 config --user set global.trusted-host "package-mirror.liara.ir mirror.cdn.ir mirror2.chabokan.net"
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
apt-get install -y \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-venv \
|
||||
pkg-config \
|
||||
build-essential \
|
||||
default-libmysqlclient-dev
|
||||
# - name: Setup Python pip mirrors
|
||||
# run: |
|
||||
# pip3 config --user set global.index-url https://package-mirror.liara.ir/repository/pypi/simple
|
||||
# pip3 config --user set global.extra-index-url https://mirror.cdn.ir/repository/pypi/simple
|
||||
# pip3 config --user set global.trusted-host "package-mirror.liara.ir mirror.cdn.ir mirror2.chabokan.net"
|
||||
# - name: Install system dependencies
|
||||
# run: |
|
||||
# apt-get install -y \
|
||||
# python3 \
|
||||
# python3-pip \
|
||||
# python3-venv \
|
||||
# pkg-config \
|
||||
# build-essential \
|
||||
# default-libmysqlclient-dev
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
pip3 install -r requirements.txt
|
||||
pip3 install pytest flake8
|
||||
# - name: Install dependencies
|
||||
# run: |
|
||||
# python3 -m pip install --upgrade pip
|
||||
# pip3 install -r requirements.txt
|
||||
# pip3 install pytest flake8
|
||||
|
||||
- name: Run lint
|
||||
# - name: Run lint
|
||||
# run: |
|
||||
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
|
||||
- name: Install ssh client
|
||||
run: |
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
apt-get install -y openssh-client
|
||||
|
||||
- name: Setup SSH key
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -H ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
ssh ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} << 'EOF'
|
||||
cd application/Ai
|
||||
git pull origin production
|
||||
docker-compose down
|
||||
docker-compose up -d
|
||||
EOF
|
||||
Reference in New Issue
Block a user