Skip to content

Docker Publish Pterodactyl Image #12

Docker Publish Pterodactyl Image

Docker Publish Pterodactyl Image #12

name: Docker Publish Pterodactyl Image
on:
workflow_call:
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Environment
uses: ./.github/workflows/setup
- name: Setup ENV Variables
run: |
echo "IMAGE_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "FULL_IMAGE_NAME=${{ env.REGISTRY }}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.FULL_IMAGE_NAME }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
context: ./docker/ptero
push: true
tags: ${{ env.FULL_IMAGE_NAME }}:ptero-latest
labels: |
org.opencontainers.image.title=${{ steps.meta.outputs.title }}
org.opencontainers.image.description=${{ steps.meta.outputs.description }}
org.opencontainers.image.version=${{ inputs.version }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ steps.meta.outputs.created }}
org.opencontainers.image.authors=${{ steps.meta.outputs.authors }}
org.opencontainers.image.url=${{ steps.meta.outputs.url }}