Add .gitea/workflows/test.yml
This commit is contained in:
1 parent
460700bf8c
commit
61a0fde869
1 file changed
+45
@@ -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"
|
||||
Reference in new issue
Block a user