Skip to content

Commit

Permalink
Update build-docker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jifollan authored and GitHub Enterprise committed Mar 20, 2025
1 parent bca46d9 commit 2f960b7
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,32 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

# Step 2: Set up Docker Buildx (only if needed on your self-hosted runner)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Step 3: Log in to Docker Hub
# Step 2: Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }} # Store Docker Hub username in GitHub secrets
password: ${{ secrets.DOCKER_PASSWORD }} # Store Docker Hub password in GitHub secrets

# Step 4: Build the Backend Docker image
# Step 3: Build the Backend Docker image
- name: Build Backend Docker image
run: |
docker build --network=host -t jonafoll/backend:${{ github.sha }} ./backend
docker build -t jonafoll/backend:${{ github.sha }} ./backend
docker tag jonafoll/backend:${{ github.sha }} jonafoll/backend:latest
# Step 5: Build the Frontend Docker image
# Step 4: Build the Frontend Docker image
- name: Build Frontend Docker image
run: |
docker build --network=host -t jonafoll/frontend:${{ github.sha }} ./frontend
docker build -t jonafoll/frontend:${{ github.sha }} ./frontend
docker tag jonafoll/frontend:${{ github.sha }} jonafoll/frontend:latest
# Step 6: Push the Backend Docker image to Docker Hub
# Step 5: Push the Backend Docker image to Docker Hub
- name: Push Backend Docker image to Docker Hub
run: |
docker push jonafoll/backend:${{ github.sha }}
docker push jonafoll/backend:latest
# Step 7: Push the Frontend Docker image to Docker Hub
# Step 6: Push the Frontend Docker image to Docker Hub
- name: Push Frontend Docker image to Docker Hub
run: |
docker push jonafoll/frontend:${{ github.sha }}
Expand Down

0 comments on commit 2f960b7

Please sign in to comment.