|
1 | | -name: Automatic Report generation |
| 1 | +# Relies on the standard GitHub action setup to deploy to GitHub Pages |
| 2 | +# The really specific details are in the steps that generates the index files |
| 3 | +# (and the deployment of deno as an underling tool). |
| 4 | +name: Publish to Github Pages |
2 | 5 | on: |
3 | 6 | push: |
4 | 7 | branches: [main] |
5 | | - paths: ["reports/**", "tests/**", "src/**", "docs/drafts/*.html", "docs/drafts/config.json"] |
| 8 | + paths: ["reports/**", "tests/**", "src/**", "docs/*.html", "docs/contributing.md", "docs/config.json"] |
6 | 9 |
|
7 | | -jobs: |
8 | | - build: |
9 | | - name: Generate Reports using NodeJS |
| 10 | + # Allows workflow to be triggered manually from the Actions tab |
| 11 | + workflow_dispatch: |
10 | 12 |
|
11 | | - runs-on: ubuntu-latest |
| 13 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 14 | +permissions: |
| 15 | + contents: read |
| 16 | + pages: write |
| 17 | + id-token: write |
12 | 18 |
|
13 | | - strategy: |
14 | | - matrix: |
15 | | - node-version: [22.x] |
| 19 | +# Allow one concurrent deployment |
| 20 | +concurrency: |
| 21 | + group: "pages" |
| 22 | + cancel-in-progress: true |
16 | 23 |
|
| 24 | +jobs: |
| 25 | + deploy: |
| 26 | + environment: |
| 27 | + name: github-pages |
| 28 | + url: ${{ steps.deployment.outputs.page_url }} |
| 29 | + runs-on: ubuntu-latest |
17 | 30 | steps: |
18 | | - - uses: actions/checkout@v3 |
19 | | - - uses: actions/setup-node@v3 |
| 31 | + - name: Checkout the repository |
| 32 | + uses: actions/checkout/@v4 |
| 33 | + - name: Setup Deno |
| 34 | + uses: denoland/setup-deno@v2 |
20 | 35 | with: |
21 | | - node-version: ${{ matrix.node-version }} |
22 | | - - run: npm ci |
23 | | - - run: npm run generate |
24 | | - - name: setup git config |
| 36 | + deno-version: v2.x |
| 37 | + - name: Generate the index files |
| 38 | + # Details depend on where the script is located |
25 | 39 | run: | |
26 | | - git config user.name "Report generation bot" |
27 | | - git config user.email "<>" |
28 | | - - name: commit the changes |
29 | | - run: | |
30 | | - git add docs/*.html |
31 | | - git add docs/fragments/*.html |
32 | | - git add reports/xx-*.json |
33 | | - git add docs/opds/*.json |
34 | | - git commit -am "Automated report generation" |
35 | | - git push origin main |
36 | | -
|
37 | | -
|
| 40 | + (cd generate/src; deno run -A main.ts; rm deno.lock) |
| 41 | + - name: Setup Github Pages |
| 42 | + uses: actions/configure-pages@v5 |
| 43 | + - name: Upload artifact |
| 44 | + uses: actions/upload-pages-artifact@v3 |
| 45 | + with: |
| 46 | + # Upload entire repository |
| 47 | + path: '.' |
| 48 | + - name: Deploy to GitHub Pages |
| 49 | + id: deployment |
| 50 | + uses: actions/deploy-pages@v4 |
0 commit comments