Merge pull request #58 from andrei1058/develop #43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy with Maven | |
| on: | |
| push: | |
| branches: [master] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: production | |
| url: https://repo.andrei1058.dev | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Deploy with Maven | |
| env: | |
| MVN_REPO_USER: ${{ secrets.MVN_REPO_USER }} | |
| MVN_REPO_PASS: ${{ secrets.MVN_REPO_PASS }} | |
| ANDEV_API_TOKEN: ${{ secrets.ANDEV_API_TOKEN }} | |
| J_DOCS_USER: ${{ secrets.J_DOCS_USER }} | |
| J_DOCS_PASS: ${{ secrets.J_DOCS_PASS }} | |
| run: | | |
| sudo apt install jq -y | |
| curl -X GET https://api.andrei1058.dev/v1/resources/4/versioning/candidate -H "Accept: application/json" >> version.json | |
| export UPDATE_VERSION=`jq '.version' version.json | tr -d '"'` | |
| mvn versions:set -DnewVersion=$UPDATE_VERSION | |
| mvn versions:update-child-modules | |
| mvn clean deploy -s ci_settings.xml | |
| mvn javadoc:javadoc | |
| sudo apt install -y -qq lftp | |
| lftp -c "set ftp:ssl-allow no; open -u $J_DOCS_USER,$J_DOCS_PASS javadocs.andrei1058.dev; mirror -Rev sidebar-base/target/site/apidocs ./SidebarLib --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/" | |
| curl -X PUT https://api.andrei1058.dev/v1/resources/4/versioning/commit -H "Accept: application/json" -H "Authorization: Bearer ${{ secrets.ANDEV_API_TOKEN }}" -H "Content-Type: application/json" --data '{"confirmation": true}' >> version.json | |
| echo "UPDATE_VERSION=$UPDATE_VERSION" >> $GITHUB_ENV | |
| - name: Create Tag | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| name: ${{env.UPDATE_VERSION}} | |
| tag_name: ${{env.UPDATE_VERSION}} |