Skip to content

lotharschulz/hello-github-actions

Repository files navigation

GitHub Actions

CI/CD Docker images to Dockerhub, GitHub Packages and GitHub Container Registry with GitHub Actions

A repository exploring GitHub Actions to automate Docker deployments.

Deployment targets

Publish Docker Image to GitHub Container Registry

Publishing to GitHub Container Registry requires a personal access token with these scopes:

  • repo (full access)
  • write:packages
  • delete:packages

Store the personal access token value in a repository encypted secret (e.g. CR_PAT)

Use the repository encypted secret in a workflow file: GCR_PASSWORD: ${{ secrets.CR_PAT }}

Find the published docker images in packages type container: https://github.com/[username]?ecosystem=container&tab=packages. Please note: these images' visibility is private.

GitHub actions workflow file: https://github.com/lotharschulz/hello-github-actions/blob/main/.github/workflows/cicd.yml#L209-L228

Publish Docker Image to GitHub Packages

Publishing Docker Images to GitHub Packages using:

Find the published docker images in packages type docker: https://github.com/[username]?ecosystem=docker&tab=packages. These images' visibility is public.

See also Publishing Docker images.

CI/CD with Github actions

This repository contains a workflow to

  • test the go code
  • benchmark the go code
  • builds a docker image & uploads it to dockerhub

All that is defined in cicd.yml file.

test, benchmark, docker build/push

Talks & Presentations

Blog Post

CI/CD with GitHub Actions v2

make file targets

build

make build

test

make test
make benchmark

run

make run

build docker image

make build.docker

clean

make clean