1313#
1414# ################### 🚧 WARNING: READ THIS BEFORE USING THIS FILE 🚧 ####################
1515
16- name : Docs - Preview Deployment
16+ name : Preview Deployment
1717on :
1818 pull_request_target :
1919 types :
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
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