Skip to content

Commit

Permalink
codecentric#1579: publish-github-pages job now in both workflows. Als…
Browse files Browse the repository at this point in the history
…o refactored release-to-maven-central.yml to have 3 jobs now: publish, pages and release
  • Loading branch information
jonashackt committed Jan 15, 2021
1 parent a95fa20 commit 5cbea80
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 34 deletions.
68 changes: 34 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@ name: build
on: [push]

jobs:
# build:
# runs-on: ubuntu-latest
# steps:
#
# - uses: actions/checkout@v2
#
# - name: Set up JDK 1.8
# uses: actions/setup-java@v1
# with:
# java-version: 1.8
#
# - name: Build with Maven
# run: mvn -B install --no-transfer-progress --file pom.xml
#
# publish-snapshot:
# needs: build
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v2
#
# - name: Set up settings.xml for GitHub Packages
# uses: actions/setup-java@v1
# with:
# java-version: 1.8
#
# - name: Publish SNAPSHOT version to GitHub Packages (we can skip tests, since we only deploy, if the build workflow succeeded)
# run: mvn -B --no-transfer-progress deploy -DskipTests
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Build with Maven
run: mvn -B install --no-transfer-progress --file pom.xml

publish-snapshot:
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up settings.xml for GitHub Packages
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Publish SNAPSHOT version to GitHub Packages (we can skip tests, since we only deploy, if the build workflow succeeded)
run: mvn -B --no-transfer-progress deploy -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-github-pages:
#needs: publish-snapshot
needs: publish-snapshot
runs-on: ubuntu-latest

steps:
Expand All @@ -46,8 +46,8 @@ jobs:
with:
java-version: 1.8

- name: Generate spring-boot-admin-docs only
run: mvn -B --no-transfer-progress --projects spring-boot-admin-docs package -DskipTests
- name: Publish SNAPSHOT version to GitHub Packages (we can skip tests, since we only deploy, if the build workflow succeeded)
run: mvn -B --no-transfer-progress package --projects spring-boot-admin-docs -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -58,7 +58,7 @@ jobs:
- name: Show extracted Maven project version
run: echo ${{ steps.project.outputs.version }}

- name: Deploy GitHub Pages
- name: Deploy Asciidoc docs output to GitHub Pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/release-to-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,48 @@ jobs:
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}


publish-github-pages:
needs: publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up settings.xml for GitHub Packages
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Publish SNAPSHOT version to GitHub Packages (we can skip tests, since we only deploy, if the build workflow succeeded)
run: mvn -B --no-transfer-progress package --projects spring-boot-admin-docs -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Maven project version for Asciidoc GitHub Pages directory naming
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
id: project

- name: Show extracted Maven project version
run: echo ${{ steps.project.outputs.version }}

- name: Deploy Asciidoc docs output to GitHub Pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: spring-boot-admin-docs/target/generated-docs # The folder the action should deploy.
TARGET_FOLDER: ${{ steps.project.outputs.version }}
CLEAN: true # Automatically remove deleted files from the deploy branch


publish-github-release:
needs: publish-github-pages
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
Expand All @@ -53,6 +95,8 @@ jobs:
body: |
Grab the new version from Maven central https://repo1.maven.org/maven2/de/codecentric/
Current docs at https://codecentric.github.io/spring-boot-admin/${{ github.event.inputs.releaseversion }}/
### Things that changed in this release
${{ steps.changelog.outputs.changelog }}
draft: false
Expand Down

0 comments on commit 5cbea80

Please sign in to comment.