-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (46 loc) · 1.76 KB
/
docker-publish-ptero.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 }}