style: menu #13
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: prod | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| deploy-production: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout do repositório | |
| uses: actions/checkout@v2 | |
| - name: Install dependencies | |
| uses: appleboy/ssh-action@v1.2.0 | |
| with: | |
| host: ${{ secrets.REMOTE_HOST }} | |
| username: ${{ secrets.REMOTE_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.REMOTE_PORT }} | |
| script: | | |
| cd ${{secrets.TARGET_PRODUCTION}} | |
| composer install --no-interaction --prefer-dist --optimize-autoloader | |
| - name: Copiar arquivos para VPS | |
| uses: easingthemes/ssh-deploy@main | |
| with: | |
| SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}} | |
| ARGS: "-avz" | |
| SOURCE: "./" | |
| REMOTE_HOST: ${{secrets.REMOTE_HOST}} | |
| REMOTE_USER: ${{secrets.REMOTE_USER}} | |
| REMOTE_PORT: ${{secrets.REMOTE_PORT}} | |
| TARGET: ${{secrets.TARGET_PRODUCTION}} | |
| - name: "Limpar cache" | |
| uses: appleboy/ssh-action@v1.2.0 | |
| with: | |
| host: ${{ secrets.REMOTE_HOST }} | |
| username: ${{ secrets.REMOTE_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.REMOTE_PORT }} | |
| script: | | |
| cd ${{secrets.TARGET_PRODUCTION}} | |
| php artisan cache:clear | |
| php artisan config:clear | |
| php artisan route:clear | |
| php artisan view:clear | |
| php artisan config:cache |