---
title: "How to build and push Docker image with GitHub actions?"
url: https://daily.dev/posts/how-to-build-and-push-docker-image-with-github-actions--br8z61rkb
source_url: https://event-driven.io/en/how_to_buid_and_push_docker_image_with_github_actions
type: article
source: "Event-Driven by Oskar Dudycz"
published: 2026-06-17T11:26:23.628Z
updated: 2026-06-17T11:34:34.421Z
tags: ["devops", "docker", "cicd", "containers", "github-actions"]
reading_time: 5
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to build and push Docker image with GitHub actions?

**[Event-Driven by Oskar Dudycz](https://daily.dev/sources/event-driven-io)** · 5 min read · 0 upvotes · 0 comments

## Summary

A step-by-step guide to automating Docker image builds and publishing them to both Docker Hub and GitHub Container Registry (GHCR) using GitHub Actions. Covers registry setup including access tokens and GitHub secrets, then provides a complete workflow YAML file that builds on pull requests and pushes images only on the main branch. The pipeline is technology-agnostic and reusable across projects.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://event-driven.io/en/how_to_buid_and_push_docker_image_with_github_actions>

## Similar posts on daily.dev

- [How to Containerize a Node.js Application with Docker and Deploy with GitHub Actions](https://daily.dev/posts/how-to-containerize-a-node-js-application-with-docker-and-deploy-with-github-actions-ndb3pz7zw) · freeCodeCamp · 1 upvotes · 0 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#docker](https://daily.dev/tags/docker), [#cicd](https://daily.dev/tags/cicd), [#containers](https://daily.dev/tags/containers), [#github-actions](https://daily.dev/tags/github-actions)

[View this post on daily.dev](https://daily.dev/posts/how-to-build-and-push-docker-image-with-github-actions--br8z61rkb)
