Update Docker publish workflow to include branch name as Docker image… #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |