Skip to content

soramitsukhmer/publish-docker-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ Warning ⚠️

This action has been archived.
Please migrate to https://github.com/soramitsukhmer/docker-bake-action instead.

soramitsukhmer/publish-docker-action

This repository is considered EXPERIMENTAL and under active development until further notice. It is subject to non-backward compatible changes or removal in any future version so you should pin to a specific tag/commit of this action in your workflow (i.e soramitsukhmer/publish-docker-action@v1).

About

Build and Publish Docker Container via action composition that use Docker Buildx Bake as a high-level build command.

Usage

name: ci

on:
  schedule:
    # https://crontab.guru/#40_10_*_*_*
    - cron: "40 10 * * *"
  push:
    branches: [main]
    # Publish semver tags as releases.
    tags: ["v*.*.*"]
  pull_request:
    branches: [main]

env:
  # Use docker.io for Docker Hub if empty
  REGISTRY: ghcr.io
  # github.repository as <account>/<repo>
  IMAGE_NAME: ${{ github.repository }}

jobs:
  bake:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      # Login against a Docker registry
      # https://github.com/docker/login-action
      - name: Log into registry ${{ env.REGISTRY }}
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      # Build and push Docker image with Buildx Bake
      # https://github.com/soramitsukhmer/publish-docker-action
      - name: Build and push
        uses: soramitsukhmer/publish-docker-action@v1
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
          targets: build
          push: true

Customizing

Name Type
images List/CSV List of Docker images to use as base name for tags
targets List/CSV List of bake targets
push Bool Push to registry (default false)

Built-in actions

This action composition uses the following actions.

Keep up-to-date with GitHub Dependabot

Since Dependabot has native GitHub Actions support, to enable it on your GitHub repo all you need to do is add the .github/dependabot.yml file:

version: 2
updates:
  # Maintain dependencies for GitHub Actions
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "daily"