feat: compile both esm and cjs format of @repo/utils #14
This file contains 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: uploader | |
on: | |
push: | |
paths: | |
- 'apps/uploader/**' | |
branches: | |
- '**' | |
pull_request: | |
paths: | |
- 'apps/uploader/**' | |
branches: | |
- '**' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.14.2 | |
- name: Install dependencies | |
run: pnpm install | |
- name: Pre compilation | |
run: pnpm run build --filter uploader | |
# テスト成功時はこちらのステップが実行される | |
- name: Slack Notification on Success at Testing Stage | |
if: success() | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOKS }} | |
SLACK_CHANNEL: github-actions | |
SLACK_TITLE: Test Success | |
SLACK_COLOR: good | |
SLACK_FOOTER: 'Powered by Yancey Inc. and its affiliates.' | |
# テスト失敗時はこちらのステップが実行される | |
- name: Slack Notification on Failure at Testing Stage | |
uses: rtCamp/action-slack-notify@v2 | |
if: failure() | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOKS }} | |
SLACK_CHANNEL: github-actions | |
SLACK_TITLE: Test Failure | |
SLACK_COLOR: danger | |
SLACK_FOOTER: 'Powered by Yancey Inc. and its affiliates.' | |
deployment: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
needs: test | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.14.2 | |
- name: Install dependencies | |
run: pnpm install | |
- name: Pre compilation | |
run: pnpm run build --filter uploader | |
- name: Prepare files for deployment | |
run: | | |
mkdir -p dist | |
cp -r apps/uploader/dist/* dist/ | |
- name: Copy file via ssh key | |
uses: appleboy/scp-action@v0.1.7 | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
port: ${{ secrets.PORT }} | |
key: ${{ secrets.SSH_KEY }} | |
source: 'dist/*' | |
target: '/var/www/beg-monorepo/apps/uploader' | |
overwrite: true | |
- name: SSH to Server and Run Command | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
port: ${{ secrets.PORT }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
cd /var/www/beg-monorepo/apps/uploader | |
/home/${{ secrets.USERNAME }}/.local/share/pnpm/pm2 reload ecosystem.config.js | |
# テスト成功時はこちらのステップが実行される | |
- name: Slack Notification on Success at Deployment Stage | |
if: success() | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOKS }} | |
SLACK_CHANNEL: github-actions | |
SLACK_TITLE: Deploy Success | |
SLACK_COLOR: good | |
SLACK_FOOTER: 'Powered by Yancey Inc. and its affiliates.' | |
# テスト失敗時はこちらのステップが実行される | |
- name: Slack Notification on Failure at Deployment Stage | |
uses: rtCamp/action-slack-notify@v2 | |
if: failure() | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOKS }} | |
SLACK_CHANNEL: github-actions | |
SLACK_TITLE: Deploy Failure | |
SLACK_COLOR: danger | |
SLACK_FOOTER: 'Powered by Yancey Inc. and its affiliates.' |