Skip to content

Commit

Permalink
refactor: split gh-pages into 2 jobs
Browse files Browse the repository at this point in the history
hopefully job-level if fixes pre-emptive fail
  • Loading branch information
JonasPammer committed Feb 11, 2024
1 parent e044e74 commit 6823626
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,10 @@ concurrency:
cancel-in-progress: true

jobs:
gh-pages:
asciidoctor:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: "${{ steps.deployment.outputs.page_url }}"
steps:
### Setup
- name: check out the codebase
Expand Down Expand Up @@ -104,17 +99,46 @@ jobs:
run: asciidoctor --backend=html5 --destination-dir docs --out-file index.html README.adoc
if: github.ref == 'refs/heads/master'

- name: upload docs directory for job transfer
uses: actions/upload-artifact@v3
with:
name: docs
path: ./docs
if: github.ref == 'refs/heads/master'

gh-pages:
runs-on: ubuntu-latest
needs: asciidoctor
if: github.ref == 'refs/heads/master'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: "${{ steps.deployment.outputs.page_url }}"
steps:
### Deploy README.adoc
- name: download docs directory from previous job
uses: actions/download-artifact@v3
with:
name: docs
path: ./docs

- name: Setup Pages
uses: actions/configure-pages@b8130d9ab958b325bbde9786d62f2c97a9885a0e # v3
if: github.ref == 'refs/heads/master'

- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@a753861a5debcf57bf8b404356158c8e1e33150c # v2
with:
path: "./docs/"
if: github.ref == 'refs/heads/master'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@de14547edc9944350dc0481aa5b7afb08e75f254 # v2
if: github.ref == 'refs/heads/master'

- name: docs artifact no longer needed
uses: geekyeggo/delete-artifact@v2
with:
name: docs
failOnError: false

0 comments on commit 6823626

Please sign in to comment.