Skip to content

Commit 5ccb601

Browse files
committed
save pipeline
1 parent 5abd446 commit 5ccb601

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/maven.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
name: Java CI with Maven
1+
name: Build java API
22

33
on:
44
push:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
88
workflow_dispatch:
9+
inputs:
10+
run_tests:
11+
description: 'Run tests'
12+
required: true
13+
default: true
14+
type: boolean
15+
run_deploy:
16+
description: 'Deploy to GitHub Packages'
17+
required: true
18+
default: false
19+
type: boolean
20+
921
jobs:
1022
build:
1123
runs-on: ubuntu-latest
@@ -24,10 +36,11 @@ jobs:
2436
run: mvn -B clean package --file pom.xml
2537

2638
- name: Run Tests
39+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_tests || github.event_name != 'workflow_dispatch' }}
2740
run: mvn -B test --file pom.xml
2841

2942
- name: Publish to GitHub Packages
30-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
43+
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && inputs.run_deploy) }}
3144
run: mvn deploy -DskipTests
3245
env:
3346
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)