-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (35 loc) · 1.14 KB
/
docker.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
name: Build and push Docker Image
run-name: Deploy Docker image to GHCR by @${{ github.actor }}
env:
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
env:
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
# - run: chmod +x gradlew
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Assemble Jar
run: ./gradlew -Dorg.gradle.jvmargs=--enable-preview assemble
env:
REPO_USERNAME: ${{ secrets.REPO_USERNAME }}
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
- name: Build Docker Image
run: docker build -t cytosis -f docker/basic/Dockerfile .
- name: Tag Docker Image
run: docker tag cytosis ghcr.io/cytonicmc/cytosis:latest
- name: Login to GHCR
run: echo $GHCR_TOKEN | docker login ghcr.io -u CytonicMC --password-stdin
- name: Push Docker Image
run: docker push ghcr.io/cytonicmc/cytosis:latest