37 lines
969 B
YAML
37 lines
969 B
YAML
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: |
|
|
echo "Updating staging environment..."
|
|
docker rm -f fbird-staging || true
|
|
docker run -d \
|
|
--name fbird-staging \
|
|
--restart always \
|
|
-v $(pwd):/usr/share/nginx/html:ro \
|
|
-p 8181:80 \
|
|
nginx:alpine
|
|
echo "Staging deployed! Visit http://192.168.183.100:8181" |