Version Packages (#62) #62
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: package-release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js and pnpm | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install pnpm | |
| run: npm install -g pnpm | |
| - uses: actions/cache@v4 | |
| id: cache | |
| with: | |
| path: | | |
| node_modules | |
| .pnpm-store | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| version: pnpm changeset version | |
| publish: pnpm release:package | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PACKAGE_PUBLISH_KEY_GITHUB }} | |
| NPM_TOKEN: ${{ secrets.PACKAGE_PUBLISH_KEY_NPM }} | |
| NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_PUBLISH_KEY_NPM }} | |
| - name: build docuasurus | |
| if: steps.changesets.outputs.published == 'true' | |
| run: pnpm docs:build | |
| - name: Deploy to GitHub Pages | |
| if: steps.changesets.outputs.published == 'true' | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./build | |
| - name: Wait for 2 minutes (wait for docs deploy time) | |
| if: steps.changesets.outputs.published == 'true' | |
| run: sleep 120 | |
| - name: send slack | |
| if: steps.changesets.outputs.published == 'true' | |
| uses: rtCamp/action-slack-notify@v2 | |
| env: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| SLACK_CHANNEL: 'github_frontend' | |
| SLACK_USERNAME: 'monolith 패키지 배포' | |
| SLACK_ICON_EMOJI: ':kakaostyle' | |
| SLACK_COLOR: 'good' | |
| SLACK_TITLE: 'monolith 패키지가 새롭게 업데이트 되었어요. 🙏' | |
| SLACK_MESSAGE: '배포 내용 확인하기: <https://github.com/croquiscom/monolith/blob/main/CHANGELOG.md|변경_내역> <https://croquiscom.github.io/monolith|공식_문서>' | |
| SLACK_FOOTER: '' | |
| MSG_MINIMAL: 'true' |