Configure deploy to Artifactory for branch 1.x #54
Workflow file for this run
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: Build and push | |
| on: | |
| push: | |
| branches: | |
| - 1.x | |
| pull_request: | |
| branches: | |
| - 1.x | |
| env: | |
| JFROG_USER: ${{ secrets.ARTIFACTORY_AUTH_USER }} | |
| JFROG_PASS: ${{ secrets.ARTIFACTORY_AUTH_TOKEN }} | |
| jobs: | |
| maven-package: | |
| if: "!contains(github.event.head_commit.message, 'ci skip')" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install xmlstarlet | |
| run: | | |
| sudo rm -rf /var/lib/apt/lists/* | |
| sudo apt-get update | |
| sudo apt-get -y install xmlstarlet | |
| - name: Copy maven settings | |
| run: | | |
| wget https://raw.githubusercontent.com/entur/ror-maven-settings/master/.m2/settings.xml -O .github/workflows/settings.xml | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: 8.0.452+9 | |
| distribution: temurin | |
| - name: Cache Maven dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| ${{ runner.os }}-maven- | |
| ${{ runner.os }}- | |
| - name: Run maven build | |
| run: mvn package -s .github/workflows/settings.xml | |
| deploy-artifactory: | |
| #if: github.repository_owner == 'entur' && github.event_name == 'push' && github.ref == 'refs/heads/1.x' | |
| needs: [ maven-package ] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install xmlstarlet | |
| run: | | |
| sudo rm -rf /var/lib/apt/lists/* | |
| sudo apt-get update | |
| sudo apt-get -y install xmlstarlet | |
| - name: Copy maven settings | |
| run: | | |
| wget https://raw.githubusercontent.com/entur/ror-maven-settings/master/.m2/settings.xml -O .github/workflows/settings.xml | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: 8.0.452+9 | |
| distribution: liberica | |
| - name: Cache Maven dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| ${{ runner.os }}-maven- | |
| ${{ runner.os }}- | |
| - name: Deploy to Entur Artifactory | |
| run: mvn deploy -s .github/workflows/settings.xml -DskipTests |