Skip to content

Update docker.yml

Update docker.yml #3

Workflow file for this run

name: Build and Publish Docker Image to GHCR
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the code from the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Step 3: Log in to GitHub Container Registry (GHCR)
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }} # Use GitHub username
password: ${{ secrets.GITHUB_TOKEN }} # GitHub token is automatically available in workflows
# Step 4: Build Docker image with hardcoded name "mcp_bridge"
- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository_owner }}/mcp_bridge:${{ github.sha }} .
# Step 5: Push the Docker image to GHCR
- name: Push Docker image to GHCR
run: |
docker push ghcr.io/${{ github.repository_owner }}/mcp_bridge:${{ github.sha }}