diff --git a/.github/workflows/settings.xml b/.github/workflows/settings.xml new file mode 100644 index 00000000..da7bc996 --- /dev/null +++ b/.github/workflows/settings.xml @@ -0,0 +1,14 @@ + + + + ssh-maven-travis + ${env.REPO_USER} + /home/runner/.ssh/github_actions + + no + publickey,password + false + + + + diff --git a/.github/workflows/ukelonn-maven-ci-build.yml b/.github/workflows/ukelonn-maven-ci-build.yml index 1ebc8f37..cfc5e5d1 100644 --- a/.github/workflows/ukelonn-maven-ci-build.yml +++ b/.github/workflows/ukelonn-maven-ci-build.yml @@ -19,8 +19,20 @@ jobs: java-version: '17' distribution: 'temurin' cache: maven + - name: Add ssh key + run: | + mkdir -p /home/runner/.m2 + cp .github/workflows/settings.xml /home/runner/.m2 + mkdir -p /home/runner/.ssh + ssh-keyscan maven.bang.priv.no >> /home/runner/.ssh/known_hosts + echo "${{ secrets.MAVEN_SSH_KEY }}" > /home/runner/.ssh/github_actions + chmod 600 /home/runner/.ssh/github_actions - name: Build with Maven run: mvn -B org.jacoco:jacoco-maven-plugin:prepare-agent install coveralls:report sonar:sonar --file pom.xml --define repoToken=${{ secrets.COVERALLS_REPO_SECRET }} -Dsonar.projectKey=steinarb_ukelonn -Dsonar.organization=steinarb -Dsonar.host.url=https://sonarcloud.io env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Deploy snapshot to maven repo + run: mvn -B deploy -DskipTests=true + env: + REPO_USER: ${{ secrets.REPO_USER }}