Add GitHub Actions workflow for automated production deployment #1
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 Production | |
| on: | |
| push: | |
| branches: | |
| - master # or main, depending on your default branch name | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up SSH | |
| uses: webfactory/[email protected] | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Add server to known hosts | |
| run: | | |
| mkdir -p ~/.ssh | |
| ssh-keyscan -H profullstack >> ~/.ssh/known_hosts | |
| - name: Deploy to server | |
| run: | | |
| ./bin/deploy.sh | |
| env: | |
| DEPLOY_REMOTE_HOST: profullstack | |
| DEPLOY_REMOTE_DIR: www/profullstack.com/pdf | |
| INSTALL_SERVICE: true |