create comment #123
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 Server | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.1.32' | |
| extensions: mbstring, pdo, pdo_mysql, xml | |
| - name: Deploy via SSHPass | |
| env: | |
| SSH_HOST: ${{ secrets.SSH_HOST }} | |
| SSH_KEY: ${{ secrets.SSH_KEY }} | |
| SSH_USERNAME: ${{ secrets.SSH_USERNAME }} | |
| run: | | |
| sshpass -p "${SSH_KEY}" ssh -o StrictHostKeyChecking=no ${SSH_USERNAME}@${SSH_HOST} << 'EOF' | |
| cd /var/www/html | |
| git pull | |
| npm install | |
| npx tailwindcss -i ./src/input.css -o ./src/output.css --minify | |
| systemctl restart apache2 | |
| EOF |