CD Yaml

    - name: Deploy to Server
      if: success()
      uses: appleboy/ssh-action@master
      with:
        host: ${{ secrets.SERVER_HOST }}
        username: ${{ secrets.SERVER_USER }}
        key: ${{ secrets.SSH_PRIVATE_KEY }}
        port: 22 # Optional if your SSH server uses a different port
        script: |
          cd /path/to/your/project
          git pull
          # Any other deployment or restart service commands

    - name: Configure AWS Credentials
      uses: aws-actions/configure-aws-credentials@v1
      with:
        aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
        aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        aws-region: your-aws-region

    - name: Deploy to AWS Lambda
      run: |
        # Package your application
        zip -r package.zip .
        # Deploy/update your Lambda function
        aws lambda update-function-code --function-name your-lambda-function-name --zip-file fileb://package.zip

Last updated