Skip to content

Build and Push Docker Image #11

Build and Push Docker Image

Build and Push Docker Image #11

Workflow file for this run

name: Build and Push Docker Image
on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
env:
BASE_IMAGE_NAME: kjuly/mkdocs
MATERIAL_IMAGE_NAME: kjuly/mkdocs-material
MATERIAL_IMAGE_DOCKERFILE: Dockerfile-material
permissions:
contents: read
packages: write
id-token: write
attestations: write
concurrency:
group: "images"
cancel-in-progress: false
jobs:
build-n-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# mkdocs
- name: Build and Push Image to Docker Hub - mkdocs
uses: kjuly/docker-image-publisher@main
with:
image_name: ${{ env.BASE_IMAGE_NAME }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Image to Github Container Registry - mkdocs
uses: kjuly/docker-image-publisher@main
with:
registry: ghcr.io
image_name: ${{ env.BASE_IMAGE_NAME }}
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}
# mkdocs + theme:material
- name: Build and Push Image to Docker Hub - mkdocs+material
uses: kjuly/docker-image-publisher@main
with:
image_name: ${{ env.MATERIAL_IMAGE_NAME }}
dockerfile: ${{ env.MATERIAL_IMAGE_DOCKERFILE }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Image to Github Container Registry - mkdocs+material
uses: kjuly/docker-image-publisher@main
with:
registry: ghcr.io
image_name: ${{ env.MATERIAL_IMAGE_NAME }}
dockerfile: ${{ env.MATERIAL_IMAGE_DOCKERFILE }}
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}