From eb0bbc3ca95a11a45f2c34700dc0a804c41e74d3 Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 6 Feb 2026 09:13:46 +0000 Subject: [PATCH] adding yaml --- app.py | 2 +- gitea/workflows/deploy.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gitea/workflows/deploy.yaml diff --git a/app.py b/app.py index 6b2e0c4..b4adcb4 100644 --- a/app.py +++ b/app.py @@ -115,5 +115,5 @@ def delete_file(): if __name__ == '__main__': # Run on localhost - print("Starting File Explorer on http://127.0.0.1:80") + print("Starting File Explorer on http://127.0.0.1:5005") app.run(debug=True, port=5005, host='0.0.0.0') diff --git a/gitea/workflows/deploy.yaml b/gitea/workflows/deploy.yaml new file mode 100644 index 0000000..9bb264c --- /dev/null +++ b/gitea/workflows/deploy.yaml @@ -0,0 +1,26 @@ +name: Docker Deploy +on: [push] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Build Docker Image + run: | + docker build -t my-local-app:latest . + + - name: Deploy to CasaOS (Docker) + run: | + # Stop and remove the old container if it exists + docker stop my-running-app || true + docker rm my-running-app || true + + # Run the new container + docker run -d \ + --name my-running-app \ + -p 9002:5005 \ + --restart always \ + my-local-app:latest \ No newline at end of file