@@ -19,14 +19,32 @@ jobs:
19
19
deploy :
20
20
name : Cloudflare Pages Deployment
21
21
if : >
22
- github.repository == 'QwikDev/qwik' &&
23
- github.event.workflow_run.conclusion == 'success'
22
+ github.repository == 'QwikDev/qwik'
24
23
runs-on : ubuntu-latest
25
24
steps :
25
+ - name : Check for docs artifact
26
+ id : check-artifact
27
+ uses : actions/github-script@v7
28
+ with :
29
+ script : |
30
+ try {
31
+ await github.rest.actions.downloadArtifact({
32
+ owner: context.repo.owner,
33
+ repo: context.repo.repo,
34
+ run_id: context.payload.workflow_run.id,
35
+ artifact_name: 'artifact-docs'
36
+ });
37
+ core.setOutput('has-docs', 'true');
38
+ } catch (error) {
39
+ core.setOutput('has-docs', 'false');
40
+ }
41
+
26
42
- name : Checkout code
43
+ if : steps.check-artifact.outputs.has-docs == 'true'
27
44
uses : actions/checkout@v4
28
45
29
46
- name : Download docs artifact
47
+ if : steps.check-artifact.outputs.has-docs == 'true'
30
48
uses : actions/download-artifact@v4
31
49
id : download-artifact
32
50
with :
38
56
39
57
# not the official version, so be careful when updating
40
58
- name : Deploy to Cloudflare Pages
59
+ if : steps.check-artifact.outputs.has-docs == 'true'
41
60
uses : AdrianGonz97/refined-cf-pages-action@6c0d47ff7c97c48fa702b6d9f71f7e3a7c30c7d8
42
61
with :
43
62
apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
0 commit comments