62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
name: Deploy Test
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- develop
|
|
|
|
concurrency:
|
|
group: deploy-test-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
environment: development
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Build release archive
|
|
run: |
|
|
rm -f /tmp/release.tgz
|
|
tar \
|
|
--exclude=.git \
|
|
--exclude=.github \
|
|
--exclude=.venv \
|
|
--exclude=__pycache__ \
|
|
--exclude=node_modules \
|
|
--exclude=backend/media \
|
|
--exclude=backend/staticfiles \
|
|
--exclude=release.tgz \
|
|
-czf /tmp/release.tgz .
|
|
|
|
- name: Upload release bundle
|
|
uses: appleboy/scp-action@v1.0.0
|
|
with:
|
|
host: ${{ secrets.TEST_DEPLOY_HOST }}
|
|
username: ${{ secrets.TEST_DEPLOY_USER }}
|
|
key: ${{ secrets.TEST_DEPLOY_SSH_KEY }}
|
|
port: ${{ secrets.TEST_DEPLOY_PORT || 22 }}
|
|
source: "/tmp/release.tgz"
|
|
target: ${{ secrets.TEST_DEPLOY_PATH }}
|
|
rm: false
|
|
overwrite: true
|
|
strip_components: 0
|
|
|
|
- name: Deploy over SSH
|
|
uses: appleboy/ssh-action@v1.2.0
|
|
with:
|
|
host: ${{ secrets.TEST_DEPLOY_HOST }}
|
|
username: ${{ secrets.TEST_DEPLOY_USER }}
|
|
key: ${{ secrets.TEST_DEPLOY_SSH_KEY }}
|
|
port: ${{ secrets.TEST_DEPLOY_PORT || 22 }}
|
|
script: |
|
|
set -e
|
|
DEPLOY_DIR="${{ secrets.TEST_DEPLOY_PATH }}"
|
|
cd "$DEPLOY_DIR"
|
|
tar -xzf release.tgz
|
|
rm -f release.tgz
|
|
RUN_DJANGO_CHECK=0 DEPLOY_HEALTH_URL="http://127.0.0.1:8088/healthz/" ./scripts/deploy_stack.sh .env.test docker-compose.prod.yml
|