Skip to content

Create docker-image.yml #1

Create docker-image.yml

Create docker-image.yml #1

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build the Docker image
run: |
docker build . --file Dockerfile --tag ghcr.io/${{ github.repository }}/my-image-name:testing
- name: Push the Docker image
run: |
docker push ghcr.io/${{ github.repository }}/my-image-name:testing
- name: List Docker images
run: docker images