Skip to content

Commit f24b9e6

Browse files
committed
ci: fix preview generation info
1 parent fe1871b commit f24b9e6

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

.github/workflows/pr-preview.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#
1414
#################### 🚧 WARNING: READ THIS BEFORE USING THIS FILE 🚧 ####################
1515

16-
name: Docs - Preview Deployment
16+
name: Preview Deployment
1717
on:
1818
pull_request_target:
1919
types:
@@ -44,10 +44,6 @@ jobs:
4444
submodules: "recursive"
4545
ref: ${{ github.event.pull_request.head.ref }}
4646
repository: ${{ github.event.pull_request.head.repo.full_name }}
47-
- name: Declare some variables
48-
shell: bash
49-
run: |
50-
echo "SHA_SHORT=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
5147

5248
- name: Create comment
5349
id: comment
@@ -59,15 +55,13 @@ jobs:
5955
## ⚡ Cloudflare Pages Deployment
6056
| Name | Status | Preview |
6157
| :--- | :----- | :------ |
62-
| ${{env.BRANCH_NAME}} | 🔨 Building ([Logs](${env.ACTION_RUN})) | waiting... |
58+
| ${{env.BRANCH_NAME}} | 🔨 Building ([Logs](${{env.ACTION_RUN}})) | waiting... |
6359
6460
# Build Rust Page
65-
- uses: actions-rs/toolchain@v1
61+
- uses: dtolnay/rust-toolchain@stable
6662
with:
67-
profile: minimal
6863
toolchain: nightly-2024-02-12
6964
target: wasm32-unknown-unknown
70-
override: true
7165

7266
- uses: Swatinem/rust-cache@v2
7367
- uses: davidB/rust-cargo-make@v1
@@ -84,7 +78,12 @@ jobs:
8478
with:
8579
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
8680
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
87-
command: pages deploy ./dist --project-name=homepage --branch="${ env.BRANCH_NAME }"
81+
command: pages deploy ./dist --project-name=homepage --branch="${{ env.BRANCH_NAME }}"
82+
83+
- name: Extract hash from CF url Deploy
84+
run: |
85+
url_hash=$(echo "${{ steps.deploy.outputs.deployment-url }}" | sed -n 's|https://\([^.]*\).homepage.*|\1|p')
86+
echo "SHA_SHORT=$url_hash" >> $GITHUB_ENV
8887
8988
- name: Create comment
9089
uses: peter-evans/create-or-update-comment@v4

0 commit comments

Comments
 (0)