-
Notifications
You must be signed in to change notification settings - Fork 89
43 lines (43 loc) · 1.07 KB
/
deploy.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: Deploy
on:
push:
branches:
- dev
workflow_dispatch:
jobs:
deploy:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
- id: setup-java
name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 8
distribution: temurin
cache: maven
- id: deploy
name: Deploy Jar
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: artifact
name: Upload Jar
uses: actions/upload-artifact@v3
with:
name: PGM.jar
path: target/PGM.jar
if-no-files-found: error
- id: docker
name: Deploy Docker
run: |
mvn -pl server compile jib:build \
-Djib.to.auth.username=${{ secrets.DOCKER_USERNAME }} \
-Djib.to.auth.password=${{ secrets.DOCKER_PASSWORD }} \
-Djib.to.image=${{ secrets.DOCKER_IMAGE }} \
-Djib.to.tags=latest,${GITHUB_REF#refs/heads/},$(date +%F)