This commit is contained in:
1 parent
4ededdf3da
commit
e3dd0ceb65
1 file changed
+27
-5
+27
-5
@@ -1,15 +1,37 @@
|
|||||||
- name: Deploy Staging Preview
|
name: fbird CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main", "master" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "main", "master" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-test:
|
||||||
|
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: |
|
run: |
|
||||||
echo "Updating staging environment..."
|
echo "Updating staging environment..."
|
||||||
# Stop old staging instance if it exists
|
|
||||||
docker rm -f fbird-staging || true
|
docker rm -f fbird-staging || true
|
||||||
|
|
||||||
# Run continuous staging preview
|
|
||||||
docker run -d \
|
docker run -d \
|
||||||
--name fbird-staging \
|
--name fbird-staging \
|
||||||
--restart always \
|
--restart always \
|
||||||
-v $(pwd):/usr/share/nginx/html:ro \
|
-v $(pwd):/usr/share/nginx/html:ro \
|
||||||
-p 8181:80 \
|
-p 8181:80 \
|
||||||
nginx:alpine
|
nginx:alpine
|
||||||
|
|
||||||
echo "Staging deployed! Visit http://192.168.183.100:8181"
|
echo "Staging deployed! Visit http://192.168.183.100:8181"
|
||||||
Reference in new issue
Block a user