GitHub Action to use Docker Buildx Bake as a high-level build command
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/docker-bake-action
- name: Build and push
uses: soramitsukhmer/docker-bake-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
targets: build
push: true
Name | Type | |
---|---|---|
images | List/CSV | List of Docker images to use as base name for tags |
targets | List/CSV | List of bake targets |
pull | Bool | Always attempt to pull a newer version of the image (default false) |
push | Bool | Push is a shorthand for --set=*.output=type=registry |
- docker/setup-qemu-action
- docker/setup-buildx-action
- docker/metadata-action
- dockerbakery/github-metadata-action
- docker/bake-action
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"