Merge pull request #3 from kaakaa/downstream #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release slidev | |
on: | |
push: | |
branches-ignore: | |
- "*" | |
tags: | |
- "*" | |
concurrency: release-slidev | |
jobs: | |
release: | |
permissions: | |
contents: write | |
pages: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Japanese font # Insert these 2 lines | |
run: sudo apt install -y fonts-noto # to install Japanese font | |
- name: Setup Pages | |
id: configure-pages | |
uses: actions/configure-pages@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: "npm" | |
- run: npm ci | |
- name: Export slidev as PDF | |
run: npm run export --slide=${GITHUB_REF##*/} && npm run export:dark --slide=${GITHUB_REF##*/} | |
- uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
dist/*.pdf | |
- name: Check if OGP is enabled | |
id: checkOGP | |
uses: ./.github/actions/checkOGP | |
with: | |
file: ${GITHUB_REF##*/}/slides.md | |
- name: Generate index.html before building SPA | |
if: ${{ steps.checkOGP.outputs.ogp == 'true' }} | |
run: | | |
npm run build:before --slide=${GITHUB_REF##*/} --pagesurl=${{ steps.configure-pages.outputs.base_url }} | |
- name: Build slidev as SPA | |
run: npm run build --slide=${GITHUB_REF##*/} | |
- name: Generate preview image for OGP | |
if: ${{ steps.checkOGP.outputs.ogp == 'true' }} | |
run: | | |
npm run build:after --slide=${GITHUB_REF##*/} | |
- name: Deploy pages | |
uses: crazy-max/ghaction-github-pages@v4 | |
with: | |
keep_history: true | |
build_dir: docs | |
verbose: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
update: | |
needs: release | |
permissions: | |
contents: write | |
uses: ./.github/workflows/update-index-page.yaml | |
secrets: inherit |