Azure/static-web-apps-deploy: add documentation for `outputs.static_web_app_url`
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
Hi, I hope this is the correct place for my request, if that's not the case feel free to redirect me the correct team.
The GitHub Action `Azure/static-web-apps-deploy` has a documentation page on [docs.microsoft.com](https://docs.microsoft.com/en-us/azure/static-web-apps/build-configuration?tabs=github-actions) but it only shows the input variables.
These variables are also added to the initial workflow file that is generated by the Azure portal when a new SWA is created.
But, it's lacking documentation on how to access the preview URL during PRs with the `outputs.static_web_app_url` output variable.
**Describe the solution you'd like**
I would like to suggest two changes:
- change the docs to also include `outputs.static_web_app_url` (I can create a PR for this)
- I think it would also be helpful to add the `outputs.static_web_app_url` variable within the generated workflow that's created when a new SWA is created within the Azure portal.
**Describe alternatives you've considered**
/
**Additional context**
In the past, I already added a note about the `outputs.static_web_app_url` variable at [https://docs.microsoft.com/en-us/azure/static-web-apps/review-publish-pull-requests](https://docs.microsoft.com/en-us/azure/static-web-apps/review-publish-pull-requests), but it took me a while to find it again 😅
For reference, this is the generated workflow:
```yml
name: Azure Static Web Apps CI/CD
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main
jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_SALMON_ROCK_0FB035B03 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/" # App source code path
api_location: "" # Api source code path - optional
output_location: "build" # Built app content directory - optional
###### End of Repository/Build Configurations ######
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_SALMON_ROCK_0FB035B03 }}
action: "close"
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.