Skip to content

Commit

Permalink
Add GitHub action replacement for AppVeyor
Browse files Browse the repository at this point in the history
  • Loading branch information
bkimminich committed Dec 19, 2024
1 parent 1f1d9ba commit 7e20f8b
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: CI

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
build:
runs-on: windows-latest

env:
# nodejs_version: 18
ruby_version: 32

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Git
run: git config --global core.autocrlf true

- name: Create npm directory
run: mkdir C:\Users\runneradmin\AppData\Roaming\npm

- name: Display Node.js and npm version
run: |
node --version
npm --version
- name: Install Antora and Lunr extension
run: |
npx antora -v
npm i @antora/lunr-extension
- name: Set up Ruby
run: |
set PATH=C:\Ruby%ruby_version%\bin;%PATH%
ruby -v
gem -v
- name: Install Asciidoctor EPUB3
run: |
gem install asciidoctor-epub3
asciidoctor-epub3 -v
- name: Install Asciidoctor PDF
run: |
gem install asciidoctor-pdf
asciidoctor-pdf -v
- name: Clean build directory
run: if exist build rd /Q /S build

- name: Build Antora site
run: npx antora antora-playbook.yml

- name: Generate EPUB3
run: |
asciidoctor-epub3 -D output docs/modules/ROOT/book.adoc -t
asciidoctor-epub3 -o output/book-ctf.epub -a is_ctf=1 docs/modules/ROOT/book.adoc -t
- name: Generate PDF
run: |
asciidoctor-pdf -D output -a compress -a pdf-theme=basic -a pdf-themesdir=resources/themes -a pdf-fontsdir=resources/fonts docs/modules/ROOT/book.adoc -t
asciidoctor-pdf -o output/book-ctf.pdf -a is_ctf=1 -a compress -a pdf-theme=basic -a pdf-themesdir=resources/themes -a pdf-fontsdir=resources/fonts docs/modules/ROOT/book.adoc -t
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: build

- name: Upload EPUB and PDF
uses: actions/upload-artifact@v3
with:
name: output
path: |
output/book.epub
output/book-ctf.epub
output/book.pdf
output/book-ctf.pdf
- name: Deploy via SFTP
uses: garygrossgarten/github-action-scp@v1
with:
local: build.zip
remote: sftp_ebook@owasp-juice.shop:/antora
host: ssh.strato.de
username: ${{ secrets.SFTP_USERNAME }}
password: ${{ secrets.SFTP_PASSWORD }}

- name: Notify Slack
if: always()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}

0 comments on commit 7e20f8b

Please sign in to comment.