Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

Build and Publish Image #18

Build and Publish Image

Build and Publish Image #18

Workflow file for this run

name: Build and Publish Image
on:
workflow_dispatch:
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build the Docker image
run: docker image build -f Dockerfile --tag ghcr.io/kbdharun/cn-lab-image:latest .
# Push the image to GHCR (Image Registry)
- name: Push To GHCR
run: |
docker login ghcr.io -u ${{ env.REGISTRY_USER }} -p ${{ env.REGISTRY_PASSWORD }}
docker image push "ghcr.io/kbdharun/cn-lab-image:latest"