update #6
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: "Deploy Project" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| GIT_USER: ${{ secrets.GIT_USER_SMB }} | |
| GIT_HOST: ${{ secrets.GIT_HOST_SMB }} | |
| SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY_SMB }} | |
| SSH_KNOWN_HOST: ${{ secrets.SSH_KNOWN_HOST_SMB }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Build for production | |
| run: | | |
| pnpm install --ignore-scripts | |
| pnpm run build | |
| - name: Install SSH key | |
| uses: shimataro/ssh-key-action@v2 | |
| with: | |
| key: ${{ env.SSH_PRIVATE_KEY }} | |
| known_hosts: ${{ env.SSH_KNOWN_HOST }} | |
| - name: Upload build | |
| run: | | |
| rsync -a node_modules ${{ env.GIT_USER }}@${{ env.GIT_HOST }}:apps/ssr/hagerstenstreetcut/ | |
| rsync -a .next ${{ env.GIT_USER }}@${{ env.GIT_HOST }}:apps/ssr/hagerstenstreetcut/ | |
| rsync -a public ${{ env.GIT_USER }}@${{ env.GIT_HOST }}:apps/ssr/hagerstenstreetcut/ | |
| rsync next.config.mjs ${{ env.GIT_USER }}@${{ env.GIT_HOST }}:apps/ssr/hagerstenstreetcut/ | |
| rsync package.json ${{ env.GIT_USER }}@${{ env.GIT_HOST }}:apps/ssr/hagerstenstreetcut/ | |
| rsync pnpm-lock.yaml ${{ env.GIT_USER }}@${{ env.GIT_HOST }}:apps/ssr/hagerstenstreetcut/ | |
| rsync .nvmrc ${{ env.GIT_USER }}@${{ env.GIT_HOST }}:apps/ssr/hagerstenstreetcut/ | |
| shell: bash | |
| - name: Deploy! | |
| run: | | |
| ssh ${{ env.GIT_USER }}@${{ env.GIT_HOST }} 'bash -s' < .smb/deploy.sh apps/ssr/hagerstenstreetcut | |
| shell: bash |