Skip to content

Fix var names

Fix var names #2

Workflow file for this run

name: Build and Push Docker Image
# Trigger the workflow on push or pull request to the main branch
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository code
- name: Checkout code
uses: actions/checkout@v4
# Step 2: Set up Docker Buildx (for multi-platform builds, optional)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Step 3: Log in to Docker Hub using secrets
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Step 4: Build and push the Docker image
- name: Build and push frontend Docker image
uses: docker/build-push-action@v5
with:
context: ./front # Build context (root directory, adjust if Dockerfile is elsewhere)
file: ./front/Dockerfile # Path to Dockerfile
push: ${{ github.event_name != 'pull_request' }} # Only push on push events, not PRs
tags: |
docker.io/bsvb/truth-machine-demo:${{ github.sha }}
docker.io/bsvb/truth-machine:latest
# Step 5: Build and push the backend Docker image
- name: Build and push frontend Docker image
uses: docker/build-push-action@v5
with:
context: ./back # Build context (root directory, adjust if Dockerfile is elsewhere)
file: ./back/Dockerfile # Path to Dockerfile
push: ${{ github.event_name != 'pull_request' }} # Only push on push events, not PRs
tags: |
docker.io/bsvb/truth-machine:${{ github.sha }}
docker.io/bsvb/truth-machine:latest