Skip to content

Commit b75f029

Browse files
authored
Replace git-publish with actions/deploy-pages (#213)
1 parent 68bb73a commit b75f029

1 file changed

Lines changed: 35 additions & 14 deletions

File tree

.github/workflows/main.yml

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@ name: CI
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [ 'main' ]
76
pull_request:
8-
branches:
9-
- main
7+
branches: [ 'main' ]
8+
9+
permissions: {}
1010

1111
jobs:
12-
asciidoctor:
13-
name: "Asciidoctor"
12+
13+
build-user-guide:
14+
15+
name: Build User Guide
1416
runs-on: ubuntu-latest
17+
1518
steps:
1619
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1720
- name: Set up JDK 11
@@ -20,12 +23,30 @@ jobs:
2023
distribution: 'zulu'
2124
java-version: 11
2225
cache: 'gradle'
23-
- name: Run Asciidoctor
26+
- name: Build User Guide
2427
run: ./gradlew asciidoctor
25-
- name: Publish to GitHub Pages
26-
if: github.repository == 'assertj/doc' && github.event_name == 'push'
27-
run: ./gradlew --stacktrace --info gitPublishPush
28-
env:
29-
GIT_COMMITTER_NAME: GitHub Actions
30-
GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
31-
GRGIT_USER: ${{ secrets.ASCIIDOCTOR_TOKEN }}
28+
- name: Upload User Guide Artifact
29+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
30+
with:
31+
path: build/docs/asciidoc/user-guide
32+
33+
deploy-user-guide:
34+
35+
name: Deploy User Guide
36+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
37+
runs-on: ubuntu-latest
38+
needs: build-user-guide
39+
permissions:
40+
pages: write
41+
id-token: write
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
concurrency:
46+
group: github-pages
47+
cancel-in-progress: true
48+
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

0 commit comments

Comments
 (0)