Skip to content

Commit

Permalink
Update GitHub Pages workflow to publish AsciiDoc files
Browse files Browse the repository at this point in the history
The commit updates the name of the workflow to "Publish AsciiDoc to GitHub Pages" and makes changes to the steps in the job. The Ruby setup is simplified, and Asciidoctor installation is consolidated into a single step. Additionally, the step for compiling other formats is removed, and a new step for converting AsciiDoc to HTML is added. Finally, the step for uploading assets to GitHub Releases is replaced with a new step for deploying to GitHub Pages using peaceiris/actions-gh-pages@v3 action.
  • Loading branch information
awesome-doge committed Jan 4, 2024
1 parent 1f4cbfd commit 1a1edc7
Showing 1 changed file with 10 additions and 26 deletions.
36 changes: 10 additions & 26 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@
name: Build and Publish Book
name: Publish AsciiDoc to GitHub Pages

on:
push:
branches:
- master

jobs:
build-and-release:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Ruby
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'

- name: Install Asciidoctor
run: |
gem install asciidoctor
gem install asciidoctor-pdf
# Add other necessary tools or plugins here
- name: Compile Book to PDF
run: asciidoctor-pdf -D output book.asciidoc
# Replace book.asciidoc with your main file if different
run: gem install asciidoctor

- name: Compile Other Formats
run: |
# Add commands to generate other formats here
- name: Convert AsciiDoc to HTML
run: asciidoctor -b html5 -D output your-asciidoc-file.adoc

- name: Upload to GitHub Releases
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./output/book.pdf
asset_name: book.pdf
asset_content_type: application/pdf
# Repeat for other formats

github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./output

0 comments on commit 1a1edc7

Please sign in to comment.