Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for StartDeployment Command #27

Open
luisgj opened this issue Dec 30, 2022 · 2 comments
Open

Add support for StartDeployment Command #27

luisgj opened this issue Dec 30, 2022 · 2 comments

Comments

@luisgj
Copy link

luisgj commented Dec 30, 2022

Currently the action creates or updates the service accordingly. If support is added for a flag that jsut calls a StartDeployment for the use-cases where a user may not want to update any configuration and jiust trigger a new version of their code/image.

@luisgj luisgj changed the title Add support for StartDeploy Command Add support for StartDeployment Command Dec 30, 2022
@dmmsou
Copy link

dmmsou commented Jun 30, 2023

Until support for start-deployment is added I am having to do this. Hope it helps someone and I hope they add this feature soon.

`

    name: Deploy App Runner Image
    id: deployapi
    run: |
      
      id=$(aws apprunner start-deployment --service-arn ${{ secrets.SERVICE_ARN }})
      read opid < <(echo ${id} | jq -r '.OperationId' | tr -d '\r')
      export status="IN_PROGRESS"
      while [ "$status" == "IN_PROGRESS" ]; do
          export status=$(aws apprunner list-operations --service-arn ${{ secrets.SERVICE_ARN }} --max-results 1 | jq -r '.OperationSummaryList[0].Status' | tr -d '\r');
          echo "waiting..."
          sleep 10
      done
      echo "Deploy has completed. Checking if it was successful."
      results=$(aws apprunner list-operations --service-arn ${{ secrets.SERVICE_ARN }} --max-results 1)
      read resultid < <(echo ${results} | jq -r '.OperationSummaryList[0].Id')
      read resultstatus < <(echo ${results} | jq -r '.OperationSummaryList[0].Status' | tr -d '\r')

      if [[ "${opid}" != "${resultid}" && ${resultstatus} != 'SUCCEEDED' ]]; then
          echo "Deploy is showing a failure.  Please check your configuration and try again."
          echo "ID from start-deployment command: ${opid}"
          echo "Most recent ID from list-operations command: ${resultid}"
          echo "Most recent result status from list-operations command: ${resultstatus}"
          echo "DEPLOYFAILED=true" >> "$GITHUB_ENV"
      else
          echo "DEPLOYFAILED=false" >> "$GITHUB_ENV"
      fi
      
  - 
    name: Deploy Check
    env:
      DEPLOYFAILED: ${{ env.DEPLOYFAILED }}
    if: env.DEPLOYFAILED == 'true'
    uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
    with:
      script: |
          core.setFailed('Deployment did not return a result of SUCCEEDED')

`

@rshekhtm
Copy link

+1 to this, especially since this action doesn't seem to support VPCs so there's a need to be able to just kick off an existing service. The solution by @dmmsou is a great workaround in the mean time - kudos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants