Merge pull request #1495 from bakaphp/fix-docker-compose-dev #27
This file contains 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 EC2 | |
on: | |
push: | |
branches: | |
- 'development' | |
workflow_dispatch: | |
jobs: | |
deploy-to-ec2: | |
runs-on: ubuntu-latest | |
environment: ${{ github.ref_name }} | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Copy folder content recursively to remote VM | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.AWS_EC2_HOST }} | |
username: ${{ secrets.AWS_EC2_USERNAME }} | |
key: ${{ secrets.AWS_EC2_PRIVATE_SSH_KEY }} | |
source: . | |
target: ${{secrets.AWS_EC2_TARGET_DIR}} | |
laravel-command: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: executing remote ssh commands using password | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.AWS_EC2_HOST }} | |
username: ${{ secrets.AWS_EC2_USERNAME }} | |
key: ${{ secrets.AWS_EC2_PRIVATE_SSH_KEY }} | |
script: | | |
docker exec -it phpkanvas-ecosystem php artisan lighthouse:cache && php artisan config:cache |