expand README user guide #7
Workflow file for this run
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
| name: Deploy Production to GitHub Pages | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| concurrency: | |
| group: pages-prod | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy-prod: | |
| name: Build & deploy production (tag) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.12.0 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| # Safety check | |
| - name: Assert build output exists | |
| run: test -f dist/index.html | |
| # Deploy dist/ to gh-pages root | |
| - name: Deploy to gh-pages (production) | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_branch: gh-pages | |
| publish_dir: ./dist | |
| keep_files: true | |
| enable_jekyll: false | |
| commit_message: "Deploy production ${{ github.ref_name }}" | |
| - name: Extract changelog for release | |
| shell: bash | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| awk -v version="$VERSION" ' | |
| $0 == "## " version { capture=1; next } | |
| capture && /^## / { exit } | |
| capture { print } | |
| ' CHANGELOG.md > release-notes.md | |
| test -s release-notes.md || echo "See CHANGELOG.md for details." > release-notes.md | |
| - name: Create release for tag | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| body_path: release-notes.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |