Skip to content

Workflow file for this run

name: Build and Publish Docker Image
on:
push:
branches:
- main # Change this to your default branch if different
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}/my-image:latest .
# Replace 'my-image' with your desired image name
- name: Push Docker image
run: |
docker push ghcr.io/${{ github.repository }}/my-image:latest
# Replace 'my-image' with your desired image name