tools/.github/workflows/mdbook.yml

55 lines
1.5 KiB
YAML
Raw Permalink Normal View History

2023-12-14 04:47:54 +01:00
name: Publish mdBook container
on:
push:
branches:
- "main"
paths:
- "mdbook/**"
- ".github/workflows/mdbook.yml"
env:
IMAGE: tools-mdbook
2023-12-14 06:07:36 +01:00
VERSION: 0.4.36
VERSION_MERMAID: 0.13.0
2023-12-14 04:47:54 +01:00
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log into Registry
uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Extract Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.REGISTRY }}/${{ secrets.REGISTRY_USER }}/${{ env.IMAGE }}
labels: |
org.opencontainers.image.title=mdBook
org.opencontainers.image.description=mdBook in a container
org.opencontainers.image.version=${{ env.VERSION }}
tags: |
type=semver,pattern={{version}},value=v${{ env.VERSION }}
type=semver,pattern={{major}}.{{minor}},value=v${{ env.VERSION }}
type=semver,pattern={{major}}=v${{ env.VERSION }}
- name: Build and Push
uses: docker/build-push-action@v4
with:
context: ./mdbook
2023-12-14 04:52:00 +01:00
file: ./mdbook/Containerfile
2023-12-14 04:47:54 +01:00
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ env.VERSION }}
VERSION_MERMAID=${{ env.VERSION_MERMAID }}