Skip to content

Publish

Publish #14

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to publish'
type: choice
required: true
options:
- '2025'
- '2024'
- '2023'
- '2022'
latest:
description: 'Additionally tag image as latest'
type: boolean
required: true
default: false
env:
IMAGE_NAME: tahv/mayapy
jobs:
build-push:
name: Push image to Docker Hub
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ inputs.tag }}
type=raw,value=latest,enable=${{ inputs.latest }}
labels: |
org.opencontainers.image.title=mayapy
- name: Build and push
id: push
uses: docker/build-push-action@v5
with:
push: true
context: ./${{ inputs.tag }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}