Skip to content

Update Docker publish workflow to include branch name as Docker image… #4

Update Docker publish workflow to include branch name as Docker image…

Update Docker publish workflow to include branch name as Docker image… #4

name: Docker
on:
push:
branches: [ main, ai-engineers-echo ]
pull_request:
branches: [ main, ai-engineers-echo ]
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v4
# Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Login to GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
# Build and push Docker image to GitHub Container Registry
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
# Use the branch name as the tag for the Docker image
tags: ghcr.io/${{ env.OWNER_LC }}/vocode-next-template:${{ github.ref_name }}