Skip to content

Commit

Permalink
add ci'
Browse files Browse the repository at this point in the history
  • Loading branch information
bwerquin committed Jan 17, 2022
1 parent 2dfd017 commit c595a17
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build

on:
push:
branches:
- 'main'
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build with Maven
run: mvn install --file pom.xml
- name: Upload war
uses: actions/upload-artifact@v2
with:
name: war
path: target/*.war
release:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v2
- name: Get current version
id: version
run: echo "::set-output name=prop::$(mvn -f pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)"
- run: echo ${{steps.version.outputs.prop}}
- name: Release snapshot
id: release-snapshot
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.version.outputs.prop}}
release_name: Release ${{steps.version.outputs.prop}}
draft: false
prerelease: false
docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download build
id: download
uses: actions/download-artifact@v2
with:
name: war
path: target/
- name: Get current version
id: version
run: echo "::set-output name=prop::$(mvn -f pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)"
- run: echo ${{steps.version.outputs.prop}}
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: bwerquin/knowledge-back-office
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
tags: ${{steps.version.outputs.prop}}

0 comments on commit c595a17

Please sign in to comment.