fix: harden private test deployment workflow
This commit is contained in:
24
.github/workflows/deploy-test.yml
vendored
24
.github/workflows/deploy-test.yml
vendored
@@ -15,6 +15,23 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
environment: development
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- 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: "."
|
||||
target: ${{ secrets.TEST_DEPLOY_PATH }}
|
||||
rm: false
|
||||
overwrite: true
|
||||
strip_components: 0
|
||||
exclude: ".git,.github,.venv,__pycache__,node_modules,backend/media,backend/staticfiles"
|
||||
|
||||
- name: Deploy over SSH
|
||||
uses: appleboy/ssh-action@v1.2.0
|
||||
with:
|
||||
@@ -24,13 +41,6 @@ jobs:
|
||||
port: ${{ secrets.TEST_DEPLOY_PORT || 22 }}
|
||||
script: |
|
||||
set -e
|
||||
REPO_URL="git@github.com:${{ github.repository }}.git"
|
||||
DEPLOY_DIR="${{ secrets.TEST_DEPLOY_PATH }}"
|
||||
if [ ! -d "$DEPLOY_DIR/.git" ]; then
|
||||
git clone "$REPO_URL" "$DEPLOY_DIR"
|
||||
fi
|
||||
cd "$DEPLOY_DIR"
|
||||
git fetch --all --prune
|
||||
git checkout develop || git checkout -b develop origin/develop
|
||||
git reset --hard ${{ github.sha }}
|
||||
RUN_DJANGO_CHECK=0 DEPLOY_HEALTH_URL="http://127.0.0.1:8088/healthz/" ./scripts/deploy_stack.sh .env.test docker-compose.prod.yml
|
||||
|
||||
Reference in New Issue
Block a user