From 247fe1223fb8fefb9cb030cf087f5a304e10bc79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Haugen?= Date: Wed, 19 Mar 2025 16:07:07 +0100 Subject: [PATCH] Create deploy-dev.yml --- .github/workflows/deploy-dev.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/deploy-dev.yml diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml new file mode 100644 index 0000000..b3e389d --- /dev/null +++ b/.github/workflows/deploy-dev.yml @@ -0,0 +1,29 @@ +name: Deploy to Development + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: self-hosted + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build Docker image + run: | + # Build the Docker image and tag it with "latest" + docker build -t myapp:latest . + + - name: Stop and remove existing container + run: | + # If there's an existing container, stop and remove it. + docker rm -f myapp_container || true + + - name: Run Docker container + run: | + # Run the new container in detached mode, mapping port 80 + docker run -d --name myapp_container -p 80:80 myapp:latest