Skip to content

Latest commit

 

History

History
63 lines (47 loc) · 1.38 KB

File metadata and controls

63 lines (47 loc) · 1.38 KB

GitHub Action for Caching a Docker Image

GitHub Action implementation for building a docker image.

Usage

Use with GitHub Actions

Example: .github/workflows/CI.yml

name: "CI"
on:
  push:
    branches:
      - devel
  pull_request:
jobs:
  build_images:
    name: "Build Images"
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Login to registry
        uses: docker/login-action@v2
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Build Image
        uses: MasterOfMalt/Atom.DevOps.GitHubActions/Docker_Build_Image@v1
        with:
          image_name: "dash"
          dockerfile: "Dockerfile"
          registry: ghcr.io/your_repository_in_lower_case/

Mandatory argument:

image_name: "<your image name>"

Optional input values (and defaults):

dockerfile: "Dockerfile"
tag_name: "tag to use for the docker image"
registry: "ghcr.io/your_repository_in_lower_case/"
cache_setting: "Docker Cache setting for use in docker build."

See it in practice

You can find a working and not working PR here

Refs

The following external actions are referenced in this action:

login-action