diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index f813541..30a4032 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -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 @@ -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 @@ -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