2024-04-16 10:59:57 -05:00
|
|
|
name: Publish Docker image
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
phanpy_version:
|
|
|
|
description: Target Phanpy version
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
|
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_and_push_to_registry:
|
|
|
|
name: "Build and Push to Registry: phanpy ${{ inputs.phanpy_version }}"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to the Container registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract metadata for Docker
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v5
|
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
2024-04-16 11:15:54 -05:00
|
|
|
tags: |
|
|
|
|
${{ inputs.phanpy_version }}
|
2024-04-16 10:59:57 -05:00
|
|
|
- name: Build and push Docker image
|
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: true
|
|
|
|
build-args: |
|
|
|
|
VERSION=${{ inputs.phanpy_version }}
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|