Skip to content

fix which docker repos to use #2

fix which docker repos to use

fix which docker repos to use #2

Workflow file for this run

name: Build and Publish Docker Image
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4
# Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Log in to GitHub Container Registry
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract the tag name from the push event
- name: Get Git Tag
id: get_tag
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
# Build the Docker image
- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:${{ env.TAG }} .
# Push the Docker image to GitHub Container Registry
- name: Push Docker image
run: |
docker push ghcr.io/${{ github.repository }}:${{ env.TAG }}