diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..af0a14a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,70 @@ +name: Slides Publish CI + +on: + push: + branches: [ main ] + +jobs: + # Build job + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 + - name: Setup pnpm + uses: pnpm/action-setup@v4.0.0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Install playwright + run: pnpm exec playwright install + - name: Build the slide + run: pnpm run build + - name: Export the slide into PDF + run: pnpm run export + - name: Upload PDF + uses: actions/upload-artifact@v4 + with: + name: slides-export.pdf + path: slides-export.pdf + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v3.0.1 + with: + # Artifact name + name: dist + # Path of the directory containing the static assets. + path: dist + # Duration after which artifact will expire in days. + retention-days: 0 + + # Deploy job + deploy: + # Add a dependency to the build job + needs: build + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # Specify runner + deployment step + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4