diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..fff9563 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,54 @@ +name: deploy + +on: + push: + tags: + - '*' + +jobs: + + # Build executable Jar files and package as a Release + deploy-release: + + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - uses: actions/setup-java@v3 + with: + java-version: "18" + architecture: x64 + distribution: 'temurin' + cache: 'maven' + + - name: Create the (jar) packages and libraries + run: mvn --batch-mode clean -Dskiptest -Pproduction + + - name: Get version + id: tagName + run: | + VERSION=$(cat ./VERSION) + echo "tag=$VERSION" >> $GITHUB_OUTPUT + + - name: Build Zip file + run: | + ARCHIVE_NAME="privacydashboard-${{ steps.tagName.outputs.tag }}" + ARCHIVE_FILE="${ARCHIVE_NAME}.zip" + zip -r ${ARCHIVE_FILE} privacydashboard/target/classes + zip -r ${ARCHIVE_FILE} privacydashboard/target/flow-frontend + + + - name: Create a release + uses: softprops/action-gh-release@v1 + with: + name: v${{ steps.tagName.outputs.tag }} + files: | + ./*.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +