-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.53 KB
/
publish.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
name: 'Publish Docker Image'
on:
push:
branches:
- 'master'
pull_request:
jobs:
push_to_registry:
name: Push Image to GitHub Packages
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[push skip]')"
steps:
- name: 'Check out'
uses: actions/checkout@v4
- name: 'Docker meta'
uses: crazy-max/[email protected]
id: docker_meta
with:
images: ghcr.io/ZentriaMC/pterodactyl-docker
tags: |-
type=sha,enable=true
type=ref,enable=true,priority=600,prefix=,suffix=,event=branch
type=ref,enable=true,priority=600,prefix=pr-,suffix=,event=pr
- name: 'Log in into ghcr.io'
uses: docker/login-action@v3
if: "github.event_name != 'pull_request'"
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 'Build only'
uses: docker/build-push-action@v5
if: "github.event_name == 'pull_request'"
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: 'Build and publish'
uses: docker/build-push-action@v5
if: "github.event_name != 'pull_request'"
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}