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

Get deployment url after successful deploy #565

Open
tobiasdiez opened this issue Sep 17, 2022 · 1 comment
Open

Get deployment url after successful deploy #565

tobiasdiez opened this issue Sep 17, 2022 · 1 comment
Labels
command: deploy All issues related to the deploy command complexity: hours Issues that need less than 1 hour to be resolved priority: low (P2) Low priority scope: cli Issues happened a the ./src/cli level type: enhancement New feature or request

Comments

@tobiasdiez
Copy link

Is your feature request related to a problem? Please describe.
Since the Azure/static-web-apps-deploy action is a container action and thus doesn't work in windows workflows, I've implemented the deployment to azure using this cli. In this setting, it would be nice to get the url where the site is deployed from swa deploy to e.g show it as a comment or start api tests.

Describe the solution you'd like
swa deploy should return the deployment url (if deployment is successful). For additional convince, it would be nice if swa deploy would print the deployment url as a job output ::set-output deployment_url=<url> if the ci env variable is present.

Describe alternatives you've considered
Manual scraping of the output.

@manekinekko manekinekko added type: enhancement New feature or request priority: low (P2) Low priority scope: cli Issues happened a the ./src/cli level complexity: hours Issues that need less than 1 hour to be resolved command: deploy All issues related to the deploy command labels Sep 23, 2022
@tobiasdiez
Copy link
Author

The following powershell script provides a workaround:

          $output = swa deploy <....> --verbose=silly 2>&1 | Out-String
          Write-Host $output
          $match = $output | Select-String -Pattern 'Project deployed to (?<url>.*) '
          if ($match -eq $null) { exit 1 }
          $url = $match.Matches[0].Groups['url'].Value
          echo "url=$url" >> $env:GITHUB_OUTPUT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command: deploy All issues related to the deploy command complexity: hours Issues that need less than 1 hour to be resolved priority: low (P2) Low priority scope: cli Issues happened a the ./src/cli level type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants