1+ name : " Build and Deploy"
2+ on :
3+ release :
4+ types : [published,edited]
5+ jobs :
6+ build :
7+ # Set up the OS
8+ runs-on : ubuntu-latest
9+ env :
10+ # Nexus credentials and GitHub token
11+ NEXUS_USERNAME : ' ${{ secrets.NEXUS_USERNAME }}'
12+ NEXUS_PASSWORD : ' ${{ secrets.NEXUS_PASSWORD }}'
13+ GITHUB_TOKEN : ' ${{ secrets.GITHUB_TOKEN }}'
14+ # Set environment
15+ env : ' prod'
16+ steps :
17+ # Checkout the Code
18+ - name : Checkout Code
19+ uses : actions/checkout@v2
20+ # Set up git hashes environment variables
21+ - name : Git Hashes
22+ 23+ # Set up version from tag environment variables
24+ - name : Version from Tag Action
25+ 26+ with :
27+ remove-first-character : ' v'
28+ # Set up the JDK
29+ - name : Set up JDK 11
30+ uses : actions/setup-java@v2
31+ with :
32+ distribution : adopt
33+ java-version : 11
34+ # Make gradle executable
35+ - name : Make gradle executable
36+ run : chmod +x gradlew
37+ # Clean, Test, Publish and Build (in that order to save the artifact to the action)
38+ - name : Test, Deploy and Build with Gradle
39+ run : ./gradlew clean test publish shadow dokkaHtml
40+ # Now we store the artifact in the action
41+ - name : Upload the artifact
42+ uses : actions/upload-artifact@v2
43+ with :
44+ name : FilesModule
45+ path : ./build/libs/FilesModule-${{ env.VERSION }}.jar
46+ # Now we deploy the documents to GitHub pages
47+ - name : Deploy Dokka
48+ 49+ with :
50+ branch : gh-pages
51+ folder : build/dokka
52+ clean : true
0 commit comments