13
13
#
14
14
# ################### 🚧 WARNING: READ THIS BEFORE USING THIS FILE 🚧 ####################
15
15
16
- name : Docs - Preview Deployment
16
+ name : Preview Deployment
17
17
on :
18
18
pull_request_target :
19
19
types :
44
44
submodules : " recursive"
45
45
ref : ${{ github.event.pull_request.head.ref }}
46
46
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"
51
47
52
48
- name : Create comment
53
49
id : comment
@@ -59,15 +55,13 @@ jobs:
59
55
## ⚡ Cloudflare Pages Deployment
60
56
| Name | Status | Preview |
61
57
| :--- | :----- | :------ |
62
- | ${{env.BRANCH_NAME}} | 🔨 Building ([Logs](${env.ACTION_RUN})) | waiting... |
58
+ | ${{env.BRANCH_NAME}} | 🔨 Building ([Logs](${{ env.ACTION_RUN} })) | waiting... |
63
59
64
60
# Build Rust Page
65
- - uses : actions-rs/ toolchain@v1
61
+ - uses : dtolnay/rust- toolchain@stable
66
62
with :
67
- profile : minimal
68
63
toolchain : nightly-2024-02-12
69
64
target : wasm32-unknown-unknown
70
- override : true
71
65
72
66
- uses : Swatinem/rust-cache@v2
73
67
- uses : davidB/rust-cargo-make@v1
84
78
with :
85
79
apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
86
80
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
88
87
89
88
- name : Create comment
90
89
uses : peter-evans/create-or-update-comment@v4
0 commit comments