Skip to content

Commit d4d3c39

Browse files
Deploy to GitHub
1 parent 11eeafb commit d4d3c39

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-8
lines changed

.github/workflows/maven-publish-on-push.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,6 @@ jobs:
9393
env:
9494
MAVEN_USERNAME: ${{ secrets.NERZ_USERNAME }}
9595
MAVEN_PASSWORD: ${{ secrets.NERZ_TOKEN }}
96-
97-
- name: Publish to GitHub
98-
run: |
99-
mvn deploy -s $GITHUB_WORKSPACE/settings.xml
100-
env:
101-
MAVEN_USERNAME: ${{ github.actor }}
102-
MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
103-
10496

10597

10698

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Java CI with Maven
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out repository
14+
uses: actions/checkout@v2
15+
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: 17
20+
distribution: 'temurin'
21+
22+
- name: Configure Maven settings
23+
run: |
24+
mkdir -p ~/.m2
25+
echo "<settings>
26+
<servers>
27+
<server>
28+
<id>github</id>
29+
<username>${{ github.actor }}</username>
30+
<password>${{ secrets.GITHUB_TOKEN }}</password>
31+
</server>
32+
</servers>
33+
</settings>" > ~/.m2/settings.xml
34+
35+
- name: Build and deploy
36+
run: mvn deploy
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)