Merge branch 'develop' #116
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: Production Build/Deploy | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| inputs: | |
| deploy_comment: | |
| description: "Deploy comment" | |
| required: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| environment: Production | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '16.x' | |
| - name: Install npm dependencies | |
| run: npm install | |
| - name: Run build task | |
| run: npm run prod --if-present | |
| - name: Show Current Directory | |
| run: pwd | |
| - name: Check Build Directory | |
| run: | | |
| echo "Checking build directory contents..." | |
| ls -la ./build | |
| - name: Connect to May First Shell Account | |
| uses: baisong/mayfirst-shell-action@v0.1.1 | |
| with: | |
| comment: ${{ inputs.deploy_comment }} | |
| user: ${{ secrets.SSH_USER }} | |
| password: ${{ secrets.SSH_PASS }} | |
| - name: Deploy to Server | |
| uses: nogsantos/ssh-scp-deploy@v1.3.0 | |
| with: | |
| src: ./** # Transfer everything inside the build directory | |
| host: ${{ secrets.SSH_HOST }} | |
| remote: ${{ secrets.REMOTE_TARGET }} | |
| user: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.SSH_PORT }} |