Merge pull request #202 from SOPT-36-NINEDOT/refactor/#188/lowerTodo #122
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: CD | |
| on: | |
| push: | |
| branches: [develop, main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| cache-dependency-path: 'pnpm-lock.yaml' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build project | |
| run: pnpm build | |
| - name: Prepare deployment files | |
| run: | | |
| mkdir -p output | |
| cp -R src output/ | |
| cp -R public output/ | |
| cp package.json output/ | |
| cp pnpm-lock.yaml output/ | |
| cp index.html output/ | |
| cp vite.config.ts output/ | |
| cp tsconfig*.json output/ | |
| cp eslint.config.js output/ || true | |
| echo "Deployment prepared at $(date)" > output/BUILD_INFO.txt | |
| - name: Push to fork repository | |
| id: push_directory | |
| uses: cpina/github-action-push-to-another-repository@main | |
| env: | |
| API_TOKEN_GITHUB: ${{ secrets.AUTO_ACTIONS }} | |
| with: | |
| source-directory: 'output' | |
| destination-github-username: 'shinjigu' | |
| destination-repository-name: 'NINEDOT-CLIENT' | |
| user-email: ${{ secrets.EMAIL }} | |
| commit-message: '🚀 Latest deployment' | |
| target-branch: main | |
| - name: Test get variable exported by push-to-another-repository | |
| run: echo $DESTINATION_CLONED_DIRECTORY |