Add secrets debug step #18
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 to Apache server | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install & Build | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Debug secrets | |
| run: | | |
| echo "HOST is set: ${{ secrets.SERVER_HOST != '' }}" | |
| echo "USER is set: ${{ secrets.SERVER_USER != '' }}" | |
| echo "KEY is set: ${{ secrets.SSH_PRIVATE_KEY != '' }}" | |
| - name: Setup SSH key | |
| run: | | |
| echo "${{ secrets.SSH_PRIVATE_KEY }}" | base64 -d > /tmp/deploy_key | |
| chmod 600 /tmp/deploy_key | |
| - name: Deploy via rsync | |
| run: | | |
| rsync -avzr --delete \ | |
| -e "ssh -i /tmp/deploy_key -o StrictHostKeyChecking=no" \ | |
| dist/ ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }}:/var/www/southgreen/ |