feat: create prebuild github actions
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
name: mypy-test
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**.py'
|
||||
|
||||
jobs:
|
||||
mypy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.9
|
||||
architecture: x64
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Install mypy
|
||||
run: pip install mypy
|
||||
- name: Run mypy
|
||||
run: mypy --ignore-missing-imports ./app
|
||||
@@ -0,0 +1,41 @@
|
||||
name: Prebuild Workflow
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- prebuild
|
||||
|
||||
jobs:
|
||||
test_build:
|
||||
name: Test build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Try to build project
|
||||
run: docker-compose up --build
|
||||
|
||||
deploy_to_test_server:
|
||||
name: Deploy to test server
|
||||
needs: test_build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy to test server
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.TEST_SERVER_ADDRESS }}
|
||||
username: ${{ secrets.TEST_SERVER_USER }}
|
||||
port: ${{ secrets.TEST_SERVER_PORT }}
|
||||
password: ${{ secrets.TEST_SERVER_PASSWORD }}
|
||||
script: |
|
||||
REPO_NAME=$(basename "${{ github.repository }}")
|
||||
if [ ! -d "$REPO_NAME" ]; then
|
||||
git clone https://github.com/${{ github.repository }}.git $REPO_NAME
|
||||
fi
|
||||
cd $REPO_NAME
|
||||
|
||||
git checkout prebuild
|
||||
git pull
|
||||
|
||||
docker-compose down || true
|
||||
docker-compose up -d --build
|
||||
Reference in New Issue
Block a user