Build & Publish CSS/JS #11
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: Build & Publish CSS/JS | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" # 태그 푸시 시 자동 릴리즈/배포 | |
| workflow_dispatch: # 수동 실행도 허용 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # 릴리즈 업로드/gh-pages 푸시 | |
| pages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - run: npm install | |
| # 0) Build Step (esbuild.mjs) | |
| # esbuild -> package.json -> "release": "npm run clean && npm run build" | |
| - name: Build (with tag-derived version) | |
| run: npm run release | |
| # Debug Step | |
| - name: Debug gh-pages deploy | |
| run: | | |
| echo "Files before deploy:" | |
| find ./dist -type f -printf "%p (%k KB)\n" || true | |
| # 1) gh-pages branch dist 전체 업로드 | |
| - name: Deploy latest to Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./dist | |
| # 이 액션은 dist 내용을 gh-pages 브랜치에 푸시합니다. | |
| # 저장소 Settings → Pages → Branch: gh-pages / root 로 설정. | |
| # 2) Releases Upload Files | |
| - name: Upload versioned assets to Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| dist/jeonghun-v*.css | |
| dist/jeonghun-v*.js | |
| dist/release.html |