Skip to content

Commit c96f515

Browse files
committed
Run GitHub pages deployment as a separate action
1 parent f74c5c2 commit c96f515

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -90,25 +90,3 @@ jobs:
9090
uses: actions/attest-build-provenance@v1
9191
with:
9292
subject-path: 'target/scala-2.13/jsonoid-discovery*.jar'
93-
94-
publish-site:
95-
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/') }}
96-
needs: test
97-
runs-on: ubuntu-latest
98-
steps:
99-
- uses: actions/checkout@v4
100-
- name: Coursier cache
101-
uses: coursier/cache-action@v6
102-
- uses: coursier/setup-action@v1
103-
with:
104-
jvm: zulu:11.0.10
105-
apps: sbt scala
106-
- name: Publish site
107-
env:
108-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109-
GITHUB_PAGES_PUBLISH_FORCE_PUSH: true
110-
run: |
111-
sbt makeSite
112-
sbt generateSchemas
113-
cp target/jsonoid-schemas/*.json target/site/schemas
114-
sbt publishToGitHubPages

.github/workflows/pages.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish site
2+
3+
on:
4+
workflow_run:
5+
workflows: [CI]
6+
types: [completed]
7+
8+
jobs:
9+
publish-site:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }}
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Coursier cache
15+
uses: coursier/cache-action@v6
16+
- uses: coursier/setup-action@v1
17+
with:
18+
jvm: zulu:11.0.10
19+
apps: sbt scala
20+
- name: Publish site
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
GITHUB_PAGES_PUBLISH_FORCE_PUSH: true
24+
run: |
25+
sbt makeSite
26+
sbt generateSchemas
27+
cp target/jsonoid-schemas/*.json target/site/schemas
28+
sbt publishToGitHubPages

0 commit comments

Comments
 (0)