Compare commits
17
Commits
6bf10de5dd
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
614d6063ec | ||
|
|
728b7a9f97 | ||
|
|
59652c0341 | ||
|
|
c9301f5b92 | ||
|
|
5a220c0f9b | ||
|
|
1feb154cba | ||
|
|
f373041ca4 | ||
|
|
dbbbb66a36 | ||
|
|
94a548ec42 | ||
|
|
239d644e00 | ||
|
|
fbba4c9e3c | ||
|
|
9075071157 | ||
|
|
56b616d789 | ||
|
|
e6e8f4dcb1 | ||
|
|
61a0fde869 | ||
|
|
460700bf8c | ||
|
|
b108bb26b8 |
No files matched your search
@@ -0,0 +1,14 @@
|
|||||||
|
name: Cleanup Staging on Merge
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [closed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
cleanup:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Stop Staging Container
|
||||||
|
run: |
|
||||||
|
docker rm -f fbird-staging || true
|
||||||
|
echo "Staging container stopped"
|
||||||
@@ -1,15 +1,12 @@
|
|||||||
name: fbird CI
|
name: Test and Stage Pull Request
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [ "main", "master" ]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main", "master" ]
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
stage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -1,16 +1,14 @@
|
|||||||
name: Stop Staging Environment
|
name: "Staging: Stop / Teardown"
|
||||||
|
|
||||||
# Allows you to trigger this manually from the Gitea UI
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stop-staging:
|
stop:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Stop and Remove Staging Container
|
- name: Stop and Remove Staging Container
|
||||||
run: |
|
run: |
|
||||||
echo "Tearing down staging container..."
|
echo "Stopping staging environment..."
|
||||||
docker rm -f fbird-staging || true
|
docker rm -f fbird-staging || echo "Container fbird-staging was not running."
|
||||||
echo "Staging environment stopped successfully!"
|
echo "Staging environment stopped successfully."
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
name: "Staging: Start / Deploy"
|
||||||
|
|
||||||
|
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