-
Notifications
You must be signed in to change notification settings - Fork 157
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
How do I get the URL after a pages
preview deployment?
#81
Comments
Is there any way how to do this currently? Given that cloudflare also trims the branch name alias deploy url after certain characters, this is must have for us to be able to display deployed preview url in the PR comments. Thanks! |
You can use Pages action: https://github.com/cloudflare/pages-action |
so the pages action will deprecated at some point in the future - cloudflare/pages-action#131 (comment) How would we do this with the wrangler-action? |
For what its worth, I don't work at Cloudflare anymore. But I do see @polaroidkidd that this action now has outputs for deployment URLs: https://github.com/cloudflare/wrangler-action?tab=readme-ov-file#using-the-deployment-url-output-variable There is an example on that README which shows how you access it through - name: Deploy
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy --project-name=example
- name: print deployment-url
env:
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }}
run: echo $DEPLOYMENT_URL |
A, thanks. I was hoping for a option similar to what the pages action supplied. I looked into the action a bit and it's a lot more involved than just setting a flag to display the information in the action run or on the PR. Echoing it out will do for now though. Thanks! |
For reference, once #291 lands you will also have |
I want to use the preview deployment of
pages
inPR
and addURL
toenvironment
, but I don't know how to get the "Preview URL", it's not written in the documentation.Desired effect
When this CI is run you will see:
The text was updated successfully, but these errors were encountered: