-
-
Notifications
You must be signed in to change notification settings - Fork 34
40 lines (32 loc) · 1.1 KB
/
build-pterodactyl-geyser.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
name: Build pterodactyl-geyser
on:
workflow_dispatch:
push:
branches:
- 'master'
paths:
- 'pterodactyl-geyser/**'
- '!pterodactyl-geyser/README.md'
env:
DOCKER_OWNER: ${{ github.repository_owner }}
DOCKER_CONTAINER: pterodactyl-geyser
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Fix Docker environment variables
run: |
# Make lowercase
echo "DOCKER_OWNER=$(echo $DOCKER_OWNER | tr '[A-Z]' '[a-z]')" >> $GITHUB_ENV
echo "DOCKER_CONTAINER=$(echo $DOCKER_CONTAINER | tr '[A-Z]' '[a-z]')" >> $GITHUB_ENV
- name: Build the Docker image
run: |
docker build $DOCKER_CONTAINER/ --tag $DOCKER_CONTAINER:latest
docker tag $DOCKER_CONTAINER:latest ghcr.io/$DOCKER_OWNER/$DOCKER_CONTAINER:latest
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push to GHCR
run: |
docker push ghcr.io/$DOCKER_OWNER/$DOCKER_CONTAINER:latest