@@ -19,14 +19,32 @@ jobs:
1919 deploy :
2020 name : Cloudflare Pages Deployment
2121 if : >
22- github.repository == 'QwikDev/qwik' &&
23- github.event.workflow_run.conclusion == 'success'
22+ github.repository == 'QwikDev/qwik'
2423 runs-on : ubuntu-latest
2524 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+
2642 - name : Checkout code
43+ if : steps.check-artifact.outputs.has-docs == 'true'
2744 uses : actions/checkout@v4
2845
2946 - name : Download docs artifact
47+ if : steps.check-artifact.outputs.has-docs == 'true'
3048 uses : actions/download-artifact@v4
3149 id : download-artifact
3250 with :
3856
3957 # not the official version, so be careful when updating
4058 - name : Deploy to Cloudflare Pages
59+ if : steps.check-artifact.outputs.has-docs == 'true'
4160 uses : AdrianGonz97/refined-cf-pages-action@6c0d47ff7c97c48fa702b6d9f71f7e3a7c30c7d8
4261 with :
4362 apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
0 commit comments