Created
May 1, 2025 13:54
-
-
Save ralphschindler/4298cc3fc4a22a99a409a925e62d1fb7 to your computer and use it in GitHub Desktop.
Revisions
-
ralphschindler created this gist
May 1, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ name: Push To Master Deploy on: push: branches: - master jobs: deploy-to-server: name: Deploy To Server runs-on: ubuntu-latest steps: - name: Add public IP to AWS security group uses: sohelamin/aws-security-group-add-ip-action@master with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: 'us-east-1' aws-security-group-id: ${{ secrets.AWS_SECURITY_GROUP_ID }} port: '22' to-port: '30' protocol: 'tcp' description: 'GitHub Action' - name: Run SSH Deployment Script uses: appleboy/ssh-action@master with: host: 1.2.3.4 # REPLACE your instance IP address username: ubuntu key: ${{ secrets.SERVER_SSH_KEY }} script: | cd project-directory # REPLACE with directory on server git fetch origin git rebase origin master docker-compose -f docker-compose.production.yml exec -T web composer -q install --no-dev --ignore-platform-reqs docker-compose -f docker-compose.production.yml exec -T web artisan config:cache -q docker-compose -f docker-compose.production.yml exec -T web composer -q run restart-php