Skip to content

Commit

Permalink
Run GitHub pages deployment as a separate action
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmior committed Jul 2, 2024
1 parent f74c5c2 commit c96f515
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 22 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,3 @@ jobs:
uses: actions/attest-build-provenance@v1
with:
subject-path: 'target/scala-2.13/jsonoid-discovery*.jar'

publish-site:
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/') }}
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Coursier cache
uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
jvm: zulu:11.0.10
apps: sbt scala
- name: Publish site
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PAGES_PUBLISH_FORCE_PUSH: true
run: |
sbt makeSite
sbt generateSchemas
cp target/jsonoid-schemas/*.json target/site/schemas
sbt publishToGitHubPages
28 changes: 28 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish site

on:
workflow_run:
workflows: [CI]
types: [completed]

jobs:
publish-site:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }}
steps:
- uses: actions/checkout@v4
- name: Coursier cache
uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
with:
jvm: zulu:11.0.10
apps: sbt scala
- name: Publish site
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PAGES_PUBLISH_FORCE_PUSH: true
run: |
sbt makeSite
sbt generateSchemas
cp target/jsonoid-schemas/*.json target/site/schemas
sbt publishToGitHubPages

0 comments on commit c96f515

Please sign in to comment.