I would like to deploy to a GitHub Package Registry from a GitHub Action of a public repo.
I have a yml file for a workflow:
name: My CI
on: [push]
There is an easier way in 2020.
First, add distribution configuration to your pom.xml:
github
GitHub OWNER Apache Maven Packages
https://maven.pkg.github.com/OWNER/REPOSITORY
The id
must be github.
Second, use actions/setup-java@v1
in action
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Publish to GitHub Packages
env:
GITHUB_TOKEN: ${{ github.token }}
run: mvn deploy