@@ -94,56 +94,39 @@ jobs:
94
94
- run : echo "${{ github.event.workflow_run.pull_requests[0].number }}"
95
95
id : number
96
96
97
- DeployPreview_Tutorial :
98
- name : " Deploy: Preview"
97
+ # We can know the URL ahead of time:
98
+ # https://<SHA>.limber-glimmer-tutorial.pages.dev
99
+ # https://<SHA>.limber-glimdown.pages.dev
100
+ DeployPreview :
101
+ name : " Deploy: Preview ${{ matrix.app.name }}"
99
102
runs-on : ubuntu-latest
100
103
timeout-minutes : 15
101
104
needs : [Build]
102
105
permissions :
103
106
contents : read
104
- deployments : write
105
- outputs :
106
- tutorialUrl : ${{ steps.deploy.outputs.url }}
107
+ strategy :
108
+ matrix :
109
+ app :
110
+ - { path: "./tutorial/dist", cloudflareName: "limber-glimmer-tutorial", name: "tutorial" }
111
+ - { path: "./repl/dist", cloudflareName: "limber-glimdown", name: "limber" }
107
112
steps :
108
113
- uses : actions/download-artifact@v4
109
114
name : deploy-prep-dist
110
- - id : deploy
111
- uses : cloudflare/pages-action@v1.5.0
112
- with :
113
- branch : ${{ github.event.workflow_run.head_branch }}
114
- apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
115
- accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
116
- projectName : limber-glimmer-tutorial
117
- directory : ./deploy-prep-dist/tutorial/dist
118
- gitHubToken : ${{ secrets.GITHUB_TOKEN }}
119
-
120
- DeployPreview_Limber :
121
- name : " Deploy: Preview"
122
- runs-on : ubuntu-latest
123
- timeout-minutes : 15
124
- needs : [Build]
125
- permissions :
126
- contents : read
127
- deployments : write
128
- outputs :
129
- limberUrl : ${{ steps.deploy.outputs.url }}
130
- steps :
131
- - uses : actions/download-artifact@v4
132
- name : deploy-prep-dist
133
- - id : deploy
134
- uses : cloudflare/pages-action@v1.5.0
135
- with :
136
- branch : ${{ github.event.workflow_run.head_branch }}
137
- apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
138
- accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
139
- projectName : limber-glimdown
140
- directory : ./deploy-prep-dist/repl/dist
141
- gitHubToken : ${{ secrets.GITHUB_TOKEN }}
115
+ - name : Preview ${{ matrix.app.name }}
116
+ run : |
117
+ npx wrangler pages deploy \
118
+ ./deploy-prep-dist/${{ matrix.app.path }} \
119
+ --project-name=${{ matrix.app.cloudflareName }} \
120
+ --branch=${{ github.event.workflow_run.head_branch }} \
121
+ --commit-hash=${{ github.event.workflow_run.head_commit }}
122
+ env :
123
+ CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
124
+ CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}
142
125
143
126
PostComment :
144
127
name : Post Preview URL as comment to PR
145
128
runs-on : ubuntu-latest
146
- needs : [DeployPreview_Limber, DeployPreview_Tutorial , determinePR]
129
+ needs : [DeployPreview , determinePR]
147
130
permissions :
148
131
pull-requests : write
149
132
steps :
@@ -154,7 +137,7 @@ jobs:
154
137
message : |+
155
138
| Project | Preview URL |
156
139
| ------- | ----------- |
157
- | Limber | ${{ needs.DeployPreview_Limber.outputs.limberUrl }} |
158
- | Tutorial | ${{ needs.DeployPreview_Tutorial.outputs.tutorialUrl }} |
140
+ | Limber | https:// ${{ github.event.workflow_run.head_commit }}.limber-glimdown.pages.dev |
141
+ | Tutorial | https:// ${{ github.event.workflow_run.head_commit }}.limber-glimmer-tutorial.pages.dev |
159
142
160
143
[Logs](https://github.com/NullVoxPopuli/limber/actions/runs/${{ github.run_id }})
0 commit comments