update github action #2
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 | |
| - name: Build (with tag-derived version) | |
| run: npm run release | |
| # 1) gh-pages 브랜치로 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) 릴리즈 자산 업로드 (버전 고정본 포함) | |
| - 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 |