Skip to content

Commit

Permalink
feat: automatically parse and deploy site
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Bestel authored and abestel committed Dec 12, 2024
1 parent 6484161 commit 17e6ef7
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 559 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Publish to GitHub Pages
on:
pull_request:
workflow_dispatch:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
name: Build Site
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: actions/setup-node@v4
with:
node-version-file: package.json

- name: Install Dependencies
run: yarn install

- name: Generate Site
run: |
yarn parse
zip -r site.zip docs
- name: Upload Site
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: site.zip
path: site.zip
if-no-files-found: error


publish:
name: Publish to GitHub Pages
if: github.ref_name == 'main'
needs: [ build ]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download Site
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
name: site.zip

- name: Unzip Site
run: unzip site.zip

- name: Configure Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5

- name: Upload Artifacts
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
path: docs

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
.DS_Store
.idea/
docs/output-data.json
Loading

0 comments on commit 17e6ef7

Please sign in to comment.