Skip to content

πŸš€ Release v2.0.0 (#1068) #32

πŸš€ Release v2.0.0 (#1068)

πŸš€ Release v2.0.0 (#1068) #32

Workflow file for this run

name: Docker-Image
on:
# Allow manual trigger
workflow_dispatch:
inputs:
# Ask if docker deployment needed when manually triggered
deploy:
description: 'Deploy Docker Image (y/n)?'
required: true
default: 'n'
push:
tags:
- '*.*.*'
env:
NEEDS_VERSION: 2.0.0
jobs:
build:
strategy:
matrix:
base-image: ["sphinxdoc/sphinx:latest", "sphinxdoc/sphinx-latexpdf:latest"]
image: ["sphinxneeds", "sphinxneeds-latexpdf"]
exclude:
- base-image: "sphinxdoc/sphinx:latest"
image: "sphinxneeds-latexpdf"
- base-image: "sphinxdoc/sphinx-latexpdf:latest"
image: "sphinxneeds"
name: "Image: ${{ matrix.image }} | Baseimage: ${{ matrix.base-image }}"
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4
-
name: Set up Docker Build πŸ‹
uses: docker/setup-buildx-action@v3
-
name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}
flavor: |
latest=true
tags: |
type=pep440,pattern={{version}}
-
# Check if deployment is needed (if no manual trigger was done, defaults to 'y')
name: Check if deployment is needed
id: deploycheck
run: |
DEPLOY_CHECK=${{ github.event.inputs.deploy }}
echo "::set-output name=value::${DEPLOY_CHECK:-"y"}"
-
# Login to Docker Hub Docker Registry for deployment
name: Login to Docker Hub Docker Registry 🐸
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push html image to Doker Hub Docker Registry 🐳
id: docker_build
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' && steps.deploycheck.outputs.value == 'y' }}
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
NEEDS_VERSION=${{ env.NEEDS_VERSION }}
BASE_IMAGE=${{ matrix.base-image }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}}