-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e82a7a2
commit 56a0570
Showing
1 changed file
with
59 additions
and
59 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|