Skip to content

Commit

Permalink
CIでのmarpビルドをまとめた
Browse files Browse the repository at this point in the history
  • Loading branch information
dicenull committed Jul 1, 2024
1 parent fb276ca commit 4f25d33
Showing 1 changed file with 23 additions and 53 deletions.
76 changes: 23 additions & 53 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:
env:
LANG: 'ja_JP.UTF-8'
jobs:
build-github-desktop:
build-marp-files:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -33,61 +33,32 @@ jobs:
- name: Install Marp CLI
run: npm install -g @marp-team/marp-cli

- name: Make Directory
run: mkdir dest && cp -r ./git/imgs ./dest/imgs
- name: Configure List
run: |
CONFIG_JSON=$(cat config.json)
LENGTH=$(echo $CONFIG_JSON | jq length)
mkdir dest
- name: Build Marp git-tutorial PDF
run: marp $(cat config.json | jq -r .[0].directory)/slide.md
--pdf
-o ./dest/$(cat config.json | jq -r .[0].output_name).pdf
--allow-local-files

- name: Build Marp git-tutorial HTML
run: marp $(cat config.json | jq -r .[0].directory)/slide.md
--html
-o ./dest/$(cat config.json | jq -r .[0].output_name).html
--allow-local-files

- name: Upload Files Pages
uses: actions/upload-pages-artifact@v1
with:
path: ./dest

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: git
path: ./dest

build-basic-design:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Setup Packages
run: sudo apt update && sudo apt install jq npm fonts-noto

- name: Install Marp CLI
run: npm install -g @marp-team/marp-cli

- name: Make Directory
run: mkdir dest && cp -r ./design/imgs ./dest/imgs
- name: Copy Files
run: for i in $(seq 0 $(($LENGTH - 1))); do cp -r ./$(echo $CONFIG_JSON | jq -r .[$i].directory)/imgs ./dest/imgs; done

- name: Build Marp design PDF
run: marp $(cat config.json | jq -r .[1].directory)/slide.md
--pdf
-o ./dest/$(cat config.json | jq -r .[1].output_name).pdf
--allow-local-files
run: |
for i in $(seq 0 $(($LENGTH - 1))); do
marp $(cat config.json | jq -r .[$i].directory)/slide.md
--pdf
-o ./dest/$(cat config.json | jq -r .[$i].output_name).pdf
--allow-local-files
done
- name: Build Marp design HTML
run: marp $(cat config.json | jq -r .[1].directory)/slide.md
--html
-o ./dest/$(cat config.json | jq -r .[1].output_name).html
--allow-local-files
run: |
for i in $(seq 0 $(($LENGTH - 1))); do
marp $(cat config.json | jq -r .[$i].directory)/slide.md
--html
-o ./dest/$(cat config.json | jq -r .[$i].output_name).html
--allow-local-files
done
- name: Upload Files Pages
uses: actions/upload-pages-artifact@v1
Expand All @@ -106,8 +77,7 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs:
- build-github-desktop
- build-basic-design
- build-marp-files
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down

0 comments on commit 4f25d33

Please sign in to comment.