Update settings-path for github.workspace

This commit is contained in:
Bryan Clark 2019-12-10 14:25:15 -08:00
parent ce88feea94
commit 2e749e50a6

View file

@ -118,7 +118,7 @@ jobs:
See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file. See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file.
## Apache Maven within a self-hosted runner ## Apache Maven with a settings path
When using an Actions self-hosted runner with multiple shared runners the default `$HOME` directory can be shared by a number runners at the same time which could overwrite existing settings file. Setting the `settings-path` variable allows you to choose a unique location for your settings file. When using an Actions self-hosted runner with multiple shared runners the default `$HOME` directory can be shared by a number runners at the same time which could overwrite existing settings file. Setting the `settings-path` variable allows you to choose a unique location for your settings file.
@ -137,11 +137,11 @@ jobs:
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
username: ${{ github.actor }} # username for server authentication username: ${{ github.actor }} # username for server authentication
password: ${{ github.token }} # password or token for authentication password: ${{ github.token }} # password or token for authentication
settings-path: ./config # location for the settings.xml file settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Maven - name: Build with Maven
run: mvn -B package --file pom.xml run: mvn -B package --file pom.xml
- name: Publish to GitHub Packages Apache Maven - name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s ./config/settings.xml run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
``` ```
# License # License