Skip to content

Commit

Permalink
ci: try building pdf files
Browse files Browse the repository at this point in the history
  • Loading branch information
RangHo committed Jul 16, 2024
1 parent 980965c commit 2bb32a5
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build redirection page to PDF file

on:
workflow_call:
inputs:
name:
required: true
type: string

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Add redirection page
run: |
cd ${{ inputs.name }}
cat <<EOF > index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=index.pdf">
</head>
<body>
<p>If you are not redirected automatically, follow this <a href="index.pdf">link</a>.</p>
</body>
</html>
EOF
- name: Upload as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}
path: ${{ inputs.name }}
33 changes: 33 additions & 0 deletions .github/workflows/update-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update repository

on: [push, workflow_dispatch]

jobs:
find-talks:
name: Find all talks
runs-on: ubuntu-latest
outputs:
pdfs: ${{ steps.find-pdfs.outputs.matrix }}

steps:
- name: Find all PDF talks
id: find-pdfs
run: |
find . -name 'index.pdf' \
| xargs dirname \
| xargs basename \
| jq -R \
| jq -cs '{ "talk": . }' \
> matrix.json
echo "matrix=$(cat matrix.json)" >> $GITHUB_OUTPUT
build-pdfs:
name: Build PDF talks
needs:
- find-talks
strategy:
matrix: ${{ fromJson(needs.find-talks.outputs.pdfs) }}
uses: ./.github/workflows/build-pdf.yml
with:
name: ${{ matrix.talk }}

0 comments on commit 2bb32a5

Please # to comment.