1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-13 11:29:54 +03:00

Update deploy-preview.yml for short sha (#4475)

* Update deploy-preview.yml for short sha

* Fixing to use pages-deployment-alias-url
This commit is contained in:
Jay Blackman 2025-05-17 07:32:42 +10:00 committed by GitHub
parent 16c3b2ee4a
commit 36fd8f57c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,19 +54,25 @@ jobs:
name: dist-files
path: src/dist
- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(echo ${{ github.event.pull_request.head.sha }} | head -c 8)
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
- name: Deploy to Cloudflare
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy src/dist --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --branch ${{ github.head_ref }} --commit-dirty=true
command: pages deploy src/dist --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --branch=${{ env.COMMIT_SHORT_SHA }} --commit-dirty=true
- name: Add deployment comment
uses: thollander/actions-comment-pull-request@v3
with:
message: |
Preview URL: ${{ steps.deploy.outputs.deployment-url }}
Preview URL: ${{ steps.deploy.outputs.pages-deployment-alias-url }}
reactions: eyes, rocket
comment-tag: 'Preview URL'
mode: recreate