remove default download and export #64
This file contains hidden or 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
| # https://gist.github.com/KermanX/27461e8694f5d5b00c3817dbed15f39f | |
| name: Export | |
| on: | |
| push: | |
| branches: [main] | |
| # pull_request: | |
| # branches: | |
| # - main | |
| workflow_dispatch: | |
| jobs: | |
| export: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.5 | |
| # Cache node_modules with Bun | |
| - name: Cache node modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| **/node_modules | |
| ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('bun.lockb', 'bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Install playwright browsers | |
| run: bun x playwright install chromium --with-deps | |
| - name: Create Export Directory | |
| run: mkdir -p ./_export | |
| - name: Export | |
| run: | | |
| bun run export:pdf | |
| # bun run export:pptx | |
| - name: Generate Body | |
| run: | | |
| echo -e "## Welcome to the resource download section\n### Please download the class note in PDF or PPTX (just pictures in png) files from the assets section below"\n Best of Luck and may the fourth be with you. > ./_export/body.txt | |
| # Disable Git hooks before the action | |
| - name: Disable pre-push hook | |
| run: mv .git/hooks/pre-push .git/hooks/pre-push.bak || true | |
| - name: Create Tag | |
| uses: rickstaa/action-create-tag@v1.7.2 | |
| with: | |
| tag: export-${{ github.sha }} | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Exports for ${{ github.sha }} | |
| body_path: ./_export/body.txt | |
| tag_name: export-${{ github.sha }} | |
| make_latest: true | |
| files: | | |
| ./_export/javascript-note.pdf | |
| ./_export/javascript-note.pptx | |
| # Re-enable Git hooks after the action | |
| - name: Re-enable pre-push hook | |
| run: mv .git/hooks/pre-push.bak .git/hooks/pre-push || true |