-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (42 loc) · 1.29 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
name: 'Publish'
on:
create:
branches:
- 'main'
jobs:
publish:
if: startsWith(github.repository, 'ModdingX/') # don't run in forks
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup Java'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: 'Build Docker Image'
run: |
docker build \
--pull --no-cache \
--build-arg="VERSION=${{ github.ref_name }}" \
-t "ghcr.io/moddingx/modbadges:${{ github.ref_name }}" \
-t "ghcr.io/moddingx/modbadges:latest" \
.
- name: 'Build'
run: |
./gradlew \
-Pversion=${{ github.ref_name }} \
-PmoddingxUsername=${{ secrets.PUBLISH_USER }} \
-PmoddingxPassword=${{ secrets.PUBLISH_PASSWORD }} \
build publish
- name: 'Login to package registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish Docker Image'
run: |
docker push "ghcr.io/moddingx/modbadges:${{ github.ref_name }}"
docker push "ghcr.io/moddingx/modbadges:latest"