Skip to content

Commit

Permalink
линт тест деплой
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelGorbunov committed Jan 18, 2025
1 parent e82a7a2 commit 56a0570
Showing 1 changed file with 59 additions and 59 deletions.
118 changes: 59 additions & 59 deletions .github/workflows/drf_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,62 +84,62 @@ jobs:
POSTGRES_PASSWORD: 'some_password'
run:
python3 manage.py test -v3
#
#
# deploy:
# runs-on: ubuntu-latest
# needs: test
#
# steps:
#
# - name: Check out code
# uses: actions/checkout@v4
#
# - name: Set up SSH
# uses: webfactory/[email protected]
# with:
# ssh-private-key: ${{ secrets.SSH_KEY }}
#
#
# - name: Run bash script via ssh
# env:
# SOME_DIR: ${{ secrets.SOME_DIR }}
# run: |
# ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} "ls $SOME_DIR"
#
#
#
# - name: Copy project files to server
# run: |
# rsync -avz --exclude '__pycache__' --exclude '.git' . ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }}:${{ secrets.DEPLOY_DIR }}
#
#
# - name: Build image ,pull,push ,up
# run: |
# ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} << 'EOF'
# cd ${{ secrets.DEPLOY_DIR }}
# docker compose down --rmi local || true
# docker compose build
# docker compose up -d
# EOF




# build:
## needs: test
# runs-on: ubuntu-latest
#
# steps:
# - name: Check out code
# uses: actions/checkout@v3
#
# - name: Log in to Docker Hub
# run: echo ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
#
# - name: Build Docker image
# run: docker compose -f docker-compose.github.yml build
#
# - name: Push Docker image to Docker Hub
# run: docker compose -f docker-compose.github.yml push
#


deploy:
runs-on: ubuntu-latest
needs: test

steps:

- name: Check out code
uses: actions/checkout@v4

- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}


- name: Run bash script via ssh
env:
SOME_DIR: ${{ secrets.SOME_DIR }}
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} "ls $SOME_DIR"
- name: Copy project files to server
run: |
rsync -avz --exclude '__pycache__' --exclude '.git' . ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }}:${{ secrets.DEPLOY_DIR }}
- name: Build image ,pull,push ,up
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SERVER_IP }} << 'EOF'
cd ${{ secrets.DEPLOY_DIR }}
docker compose down --rmi local || true
docker compose build
docker compose up -d
EOF
build:
needs: test
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Log in to Docker Hub
run: echo ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin

- name: Build Docker image
run: docker compose -f docker-compose.github.yml build

- name: Push Docker image to Docker Hub
run: docker compose -f docker-compose.github.yml push

0 comments on commit 56a0570

Please sign in to comment.