Docker Publish Pterodactyl Image #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Publish Pterodactyl Image | |
on: | |
workflow_call: | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
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 | |
file: Dockerfile | |
push: true | |
tags: 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 }} | |