diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..1b51cca --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,45 @@ +name: Test and Stage Manual + +on: + workflow_dispatch: + inputs: + environment: + description: 'Target environment' + required: false + default: 'staging' + type: string + +jobs: + stage: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Verify Project Structure + run: | + echo "Checking repository files..." + ls -la + if [ ! -f "index.html" ] && [ ! -f "fbird.html" ]; then + echo "Error: Web HTML file missing!" + exit 1 + fi + echo "Project structure verified successfully." + + - name: Deploy Staging Preview + run: | + echo "Updating staging environment..." + # 1. Remove old staging container if it exists + docker rm -f fbird-staging || true + + # 2. Start fresh Nginx container + docker run -d \ + --name fbird-staging \ + --restart always \ + -p 8181:80 \ + nginx:alpine + + # 3. Copy repo contents directly into the Nginx web root + docker cp . fbird-staging:/usr/share/nginx/html/ + + echo "Staging deployed! Visit http://192.168.183.100:8181" \ No newline at end of file