Update docker-image-builder.yml #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Image CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: [ self-hosted ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Backend Docker Image | |
| run: docker build --network=host -t my-app:latest ./backend | |
| - name: Stop & Remove Old Containers | |
| run: | | |
| docker stop my-app-container || true | |
| docker rm my-app-container || true | |
| - name: Run Docker Container | |
| run: | | |
| docker run -d --name my-app-container -p 9090:8080 my-app:latest |