Skip to content

Commit

Permalink
Adding the capability to build snapshot images
Browse files Browse the repository at this point in the history
  • Loading branch information
danakim committed Nov 28, 2023
1 parent c47559b commit feaf0ec
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,35 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
server-id: openconext-releases
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Set up cache
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Exit when workflow_dispatch is triggered, and the version does not contain SNAPSHOT in it's name
run: |
echo "Only SNAPSHOT releases can be triggered with the workflow_dispatch"
exit 1
if: github.event_name == 'workflow_dispatch' && ( !endsWith(steps.versioncheck.outputs.version, '-SNAPSHOT'))

- name: Exit when a production build is triggered, and the github tag is not the same as the version in pom.xml
run: |
echo "Project version ${{ steps.versioncheck.outputs.version }} does not match git tag ${{ github.ref_name }}"
exit 1
if: github.event_name != 'workflow_dispatch' && steps.versioncheck.outputs.version != github.ref_name

- name: Deploy with Maven
run: mvn --batch-mode deploy -DskipTests
env:
Expand All @@ -52,4 +67,4 @@ jobs:
platforms: linux/amd64
push: true
tags: |
ghcr.io/openconext/openconext-voot/voot-server:${{ github.ref_name }}
ghcr.io/openconext/openconext-voot/voot-server:${{ steps.versioncheck.outputs.version }}

0 comments on commit feaf0ec

Please sign in to comment.