-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action replacement for AppVeyor
- Loading branch information
1 parent
1f1d9ba
commit 7e20f8b
Showing
1 changed file
with
104 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |