chore(deps): update pandoc/core docker digest to 2b79262 #548
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: build self-contained READMEs | |
"on": | |
push: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
# Cancel a currently running workflow from the same PR, branch or tag when a new workflow is triggered for it | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
asciidoctor: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
### Setup | |
- name: check out the codebase | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: setup ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "2.7.0" | |
- name: set up python 3 | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
with: | |
python-version: "3.x" | |
- name: install asciidoctor and other relevant ruby gems | |
run: gem install --no-document asciidoctor asciidoctor-reducer rouge coderay | |
- name: get first line of commit message as variable | |
shell: bash | |
run: | | |
echo "FIRST_LINE_OF_HEAD_COMMIT_MESSAGE=${HEAD_COMMIT_MESSAGE}" | head -1 >> $GITHUB_ENV | |
env: | |
HEAD_COMMIT_MESSAGE: "${{ github.event.head_commit.message }}" | |
### README.orig.adoc & co. | |
- name: Generate README.adoc using ascidoctor-reducer. | |
run: asciidoctor-reducer README.orig.adoc -o README.adoc | |
- name: generate README.xml from README.adoc using ascidoctor | |
run: asciidoctor -b docbook README.adoc | |
- name: Generate README.md from README.xml using pandoc | |
uses: docker://pandoc/core@sha256:2b79262284929afdbe98b73097bfc6ed0e1fb5b0ea59db984890e6b84d5fe17a | |
with: | |
args: "-f docbook -t markdown_strict README.xml -o README.md --wrap=none" | |
### SECURITY.adoc | |
- name: generate SECURITY.xml from SECURITY.adoc using ascidoctor | |
run: asciidoctor -b docbook SECURITY.adoc | |
- name: Generate SECURITY.md from SECURITY.xml using pandoc | |
uses: docker://pandoc/core:3.13@sha256:e65b0b3dd2efb37f8f28caaf875efef0d1b37df71082cc8cb43ea66146b0aade | |
with: | |
args: "-f docbook -t markdown_strict SECURITY.xml -o SECURITY.md --wrap=none" | |
### Commit | |
- name: add 'changes will be lost' comment to generated files | |
run: | | |
sed -i \ | |
'1s|^|This file is being generated by .github/workflows/gh-pages.yml - all local changes will be lost eventually!\n|' \ | |
README.adoc README.md SECURITY.md | |
sed -i '1s|\(.*\)|<!-- \1 -->|' README.md SECURITY.md | |
sed -i '1s|\(.*\)|// \1|' README.adoc | |
- id: is_renovate | |
run: echo "is_renovate=$( [[ ${GITHUB_REF#refs/heads/} != renovate/* ]] && echo false || echo true )" >> $GITHUB_OUTPUT | |
- name: Commit generated files. | |
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5 | |
with: | |
commit_message: "${{ env.FIRST_LINE_OF_HEAD_COMMIT_MESSAGE }}\n${{ github.sha }}" | |
file_pattern: README.adoc README.md SECURITY.md | |
disable_globbing: true | |
if: steps.is_renovate.outputs.is_renovate == 'false' | |
### Deploy README.adoc | |
- name: Generate HTML | |
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@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | |
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 | |
# delete-artifact@v4 | |
actions: 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@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
with: | |
name: docs | |
path: ./docs | |
- name: Setup Pages | |
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4 | |
- name: Upload Pages Artifact | |
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 | |
with: | |
path: "./docs/" | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 | |
- name: docs artifact no longer needed | |
uses: geekyeggo/delete-artifact@65041433121f7239077fa20be14c0690f70569de # v4 | |
with: | |
name: docs | |
failOnError: false |