Skip to content

serversideup/github-action-docker-build

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Header Image

License Support us
Discourse users Discord

Hi! We're Dan and Jay. We're a two person team with a passion for open source products. We created Server Side Up to help share what we learn.

Find us at:

  • 📖 Blog - get the latest guides and free courses on all things web/mobile development.
  • 🙋 Community - get friendly help from our community members.
  • 🤵‍♂️ Get Professional Help - get guaranteed responses within next business day.
  • 💻 GitHub - check out our other open source projects
  • 📫 Newsletter - skip the algorithms and get quality content right to your inbox
  • 🐥 Twitter - you can also follow Dan and Jay
  • ❤️ Sponsor Us - please consider sponsoring us so we can create more helpful resources

Our Sponsors

All of our software is free an open to the world. None of this can be brought to you without the financial backing of our sponsors.

Individual Supporters

deligoez  alexjustesen  

About this project

This is a GitHub Action intended to simplify the process for building automated Docker images with GitHub Actions.

Features:

  • ✅ Stupid simple to use
  • 🚀 Customize your docker image names/tags by easily passing what you want it to be
  • 🤓 Multi-arch support
  • 🔀 Context aware (great if you have a Docker file in a different part of your repo)

Usage

Here is an example workflow:

name: Docker Publish (Production Images)
on:
  push:

jobs:
  docker-publish:
    runs-on: ubuntu-22.04
    steps:
      - name: docker-build-action
        uses: serversideup/github-action-docker-build@v3
        with:
          tags: serversideup/financial-freedom:latest
          registry-username: ${{ secrets.DOCKER_HUB_USERNAME }}
          registry-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
          platforms: "linux/amd64,linux/arm/v7,linux/arm64/v8"

Configuration options

🔀 Input Name 📚 Description 🛑 Required 👉 Default
tags Enter the tag you would like to name your image with. (example: myorg/myapp:production) ⚠️ Yes
registry-username Enter the username to authenticate with your registry. ⚠️ Yes
registry-token Enter the token or password to authenticate with your registry. (an access token is highly recommended) ⚠️ Yes
registry Choose which container image repository to upload to. See all options. Docker Hub
context The relative path to the Dockerfile. .
dockerfile Filename of the Dockerfile within the context that you set. {context}/Dockerfile
platforms Comma separated list of platforms. linux/amd64
target The target build stage to build. ''

Important security notice

Always use encrypted secrets when passing sensitive information. Learn more here →

Security Disclosures

If you find a security vulnerability, please let us know as soon as possible.

View Our Responsible Disclosure Policy →