Skip to content

Add docker login step #2

Add docker login step

Add docker login step #2

Workflow file for this run

name: Docker Publish
on:
push:
branches: ["build-docker-container-in-ci"]
jobs:
docker-build:
runs-on: ubuntu-24.04
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ REGISTRY }}

Check failure on line 18 in .github/workflows/docker-publish.yml

View workflow run for this annotation

GitHub Actions / Docker Publish

Invalid workflow file

The workflow is not valid. .github/workflows/docker-publish.yml (Line: 18, Col: 21): Unrecognized named-value: 'REGISTRY'. Located at position 1 within expression: REGISTRY
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: docker build -t "${REGISTRY}/${IMAGE_NAME}:main" .
- name: Push Docker image
run: docker push "${REGISTRY}/${IMAGE_NAME}:main"