Skip to content

Commit

Permalink
infra: move publish job to separate job in site.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
romani committed Jan 18, 2025
1 parent 28c5b6a commit 8945381
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,7 @@ jobs:
generate_site:
needs: parse_pr_info
runs-on: ubuntu-latest
outputs:
message: ${{ steps.out.outputs.message}}
steps:
- name: Checkout master branch
uses: actions/checkout@v4
with:
repository: checkstyle/checkstyle

# fetch-depth - number of commits to fetch.
# 0 indicates all history for all branches and tags.
# 0, because we need access to all branches to create a report.
Expand All @@ -94,7 +87,7 @@ jobs:
fetch-depth: 0

- name: Setup local maven cache
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }}
Expand All @@ -105,6 +98,36 @@ jobs:
cd .ci-temp/checkstyle
mvn -e --no-transfer-progress clean site -Pno-validations -Dmaven.javadoc.skip=false
- name: Setup local maven cache
uses: actions/cache/save@v4
with:
path: .ci-temp/checkstyle/target/site
key: checkstyle-site-cache-${{ github.run_id }}


publish_site:
needs: [ parse_pr_info, generate_site ]
runs-on: ubuntu-latest
outputs:
message: ${{ steps.out.outputs.message}}
steps:
- name: Checkout master branch
uses: actions/checkout@v4
with:
repository: checkstyle/checkstyle

- name: Setup local maven cache
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }}

- name: Setup local maven cache
uses: actions/cache/restore@v4
with:
path: .ci-temp/checkstyle/target/site
key: checkstyle-site-cache-${{ github.run_id }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down Expand Up @@ -135,7 +158,7 @@ jobs:
# should be always last step
send_message:
runs-on: ubuntu-latest
needs: [ generate_site ]
needs: [ publish_site ]
if: failure() || success()
steps:
- name: Checkout master branch
Expand All @@ -145,7 +168,7 @@ jobs:

- name: Get message
env:
MSG: ${{needs.generate_site.outputs.message}}
MSG: ${{needs.publish_site.outputs.message}}
run: |
mkdir -p .ci-temp
if [ -z "$MSG" ]; then
Expand Down

0 comments on commit 8945381

Please sign in to comment.