From c7582fb9325b32d82ab6daf57523fc9c496b1032 Mon Sep 17 00:00:00 2001 From: Jonathan Inge Arvesen Folland Date: Thu, 20 Mar 2025 13:52:08 +0100 Subject: [PATCH] Update build-docker.yml --- .github/workflows/build-docker.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index d284bbc..d223519 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -26,29 +26,29 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} # Store Docker Hub username in GitHub secrets password: ${{ secrets.DOCKER_PASSWORD }} # Store Docker Hub password in GitHub secrets - # Step 3: Build the Backend Docker image + # Step 4: Build the Backend Docker image - name: Build Backend Docker image run: | - sudo docker build -t jonafoll/backend:${{ github.sha }} ./backend - sudo docker tag jonafoll/backend:${{ github.sha }} jonafoll/backend:latest + docker build --network=host -t jonafoll/backend:${{ github.sha }} ./backend + docker tag jonafoll/backend:${{ github.sha }} jonafoll/backend:latest - # Step 4: Build the Frontend Docker image + # Step 5: Build the Frontend Docker image - name: Build Frontend Docker image run: | - sudo docker build -t jonafoll/frontend:${{ github.sha }} ./frontend - sudo docker tag jonafoll/frontend:${{ github.sha }} jonafoll/frontend:latest + docker build --network=host -t jonafoll/frontend:${{ github.sha }} ./frontend + docker tag jonafoll/frontend:${{ github.sha }} jonafoll/frontend:latest - # Step 5: Push the Backend Docker image to Docker Hub + # Step 6: Push the Backend Docker image to Docker Hub - name: Push Backend Docker image to Docker Hub run: | - sudo docker push jonafoll/backend:${{ github.sha }} - sudo docker push jonafoll/backend:latest + docker push jonafoll/backend:${{ github.sha }} + docker push jonafoll/backend:latest - # Step 6: Push the Frontend Docker image to Docker Hub + # Step 7: Push the Frontend Docker image to Docker Hub - name: Push Frontend Docker image to Docker Hub run: | - sudo docker push jonafoll/frontend:${{ github.sha }} - sudo docker push jonafoll/frontend:latest + docker push jonafoll/frontend:${{ github.sha }} + docker push jonafoll/frontend:latest deploy: runs-on: [self-hosted]