Skip to content

Commit

Permalink
Create github action workflow for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
DEENUU1 committed Dec 23, 2023
1 parent 1c40abd commit 98fe7e8
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ec2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Continuous Integration


on:
push:
branches:
- main

concurrency:
group: main
cancel-in-progress: true

jobs:
quality-assurance:
name: Run Tests
uses: ./.github/workflows/pytest.yml

deploy:
name: Deploy
needs: quality-assurance
runs-on: ubuntu-latest
steps:
- name: Configure SSH
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_HOST: ${{secrets.SSH_HOST}}
SSH_USER: ${{secrets.SSH_USER}}
run:
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ~/.ssh/github
chmod 600 ~/.ssh/github
cat >>~/.ssh/config <<END
Host target
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/github
LogLevel ERROR
StrictHostKeyChecking no
END
- name: Run deploy
run: |
ssh target "cd fjob_backend/" && docker-compose down && git pull && docker-compose build && docker-compose up -d --force-recreate"

0 comments on commit 98fe7e8

Please sign in to comment.