From 566c852648c03b43c65cb71d4a742215a6800cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl?= Date: Wed, 8 Sep 2021 22:35:35 +0200 Subject: [PATCH] feat: replace gitlab-ci by github actions --- .github/workflows/pages.yml | 24 ++++++++++++ .github/workflows/pandoc.yml | 73 ++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 45 ---------------------- 3 files changed, 97 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/pages.yml create mode 100644 .github/workflows/pandoc.yml delete mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..bec9159 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,24 @@ +name: Pages deployment + +on: + push: + +jobs: + deploy: + runs-on: [ self-hosted, ubuntu-latest ] + steps: + - uses: actions/checkout@v2 + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: '0.4.10' + + - run: mdbook build + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/github' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./out/html \ No newline at end of file diff --git a/.github/workflows/pandoc.yml b/.github/workflows/pandoc.yml new file mode 100644 index 0000000..da6ce47 --- /dev/null +++ b/.github/workflows/pandoc.yml @@ -0,0 +1,73 @@ +name: Pandoc + +on: push + +jobs: + pdf: + runs-on: [ self-hosted, ubuntu-latest ] + steps: + - uses: actions/checkout@v2 + - name: create file list + id: files_list + run: | + mkdir output + echo "::set-output name=files::$(printf '"%s" ' src/??-*.md)" + - uses: docker://pandoc/latex:2.9 + with: + args: >- + --resource-path src + --toc --toc-depth=2 + --webtex + -f markdown --pdf-engine=xelatex --listings + --metadata-file=metadata.pandoc.yml + --output=output/result.pdf + ${{ steps.files_list.outputs.files }} + - uses: actions/upload-artifact@master + with: + name: pdf + path: output + docx: + runs-on: [ self-hosted, ubuntu-latest ] + steps: + - uses: actions/checkout@v2 + - name: create file list + id: files_list + run: | + mkdir output + echo "::set-output name=files::$(printf '"%s" ' src/??-*.md)" + - uses: docker://pandoc/core:2.9 + with: + args: >- + --resource-path src + --toc --toc-depth=2 + --webtex + --metadata-file=metadata.pandoc.yml + --output=output/result.docx + ${{ steps.files_list.outputs.files }} + - uses: actions/upload-artifact@master + with: + name: docx + path: output + epub: + runs-on: [ self-hosted, ubuntu-latest ] + steps: + - uses: actions/checkout@v2 + - name: create file list + id: files_list + run: | + mkdir output + echo "::set-output name=files::$(printf '"%s" ' src/??-*.md)" + - uses: docker://pandoc/core:2.9 + with: + args: >- + --resource-path src + --toc --toc-depth=2 + --webtex + --epub-cover-image=src/images/cover.png + --metadata-file=metadata.pandoc.yml + --output=output/result.epub + ${{ steps.files_list.outputs.files }} + - uses: actions/upload-artifact@master + with: + name: epub + path: output diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 7fcf2c3..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,45 +0,0 @@ -stages: - - docs - - prebuild - - build - - release - -include: - - project: fabnum-minarm/igloo/gitlab-templates - file: - - /pandoc.all.yml - - /mdbook.auto.yml - - /pages.auto.yml - - /releaser.auto.yml - - /npm.yml - -variables: - GENERIC_PACKAGE_NAME: stargate - -pack-pm2: - extends: .igloo:npm:install - cache: - policy: pull - stage: prebuild - before_script: [] - script: - - npm i -g pm2 - - mkdir -p pm2 && cd $_ - - tar -C $(npm list -g --depth=0 | head -1)/node_modules -cjf $CI_PROJECT_DIR/pm2.tar.bz2 pm2 - - ls -al - artifacts: - paths: - - pm2.tar.bz2 - -.igloo:build:docs:pandoc: - rules: - - if: "$CI_COMMIT_BRANCH || $CI_COMMIT_TAG" - exists: - - metadata.pandoc.yml - - src/??-*.md - when: always - - when: never - -pages: - only: - - master