Skip to content

Commit b3ff7a7

Browse files
authored
chore(ci): always deploy docs (#7485)
1 parent e43d472 commit b3ff7a7

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
id: check-artifact
2727
uses: actions/github-script@v7
2828
with:
29+
retries: 3
2930
script: |
3031
try {
3132
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
@@ -35,21 +36,17 @@ jobs:
3536
});
3637
const hasDocsArtifact = artifacts.data.artifacts.some(a => a.name === 'artifact-docs');
3738
core.setOutput('has-docs', hasDocsArtifact);
38-
// Always return success from this script
39-
return true;
4039
} catch (error) {
4140
console.error('Error checking for artifacts:', error);
4241
core.setOutput('has-docs', false);
43-
// Always return success from this script
44-
return true;
4542
}
4643
4744
- name: Checkout code
48-
if: ${{ steps.check-artifact.outputs['has-docs'] == true }}
45+
if: ${{ steps.check-artifact.outputs.has-docs == 'true' }}
4946
uses: actions/checkout@v4
5047

5148
- name: Download docs artifact
52-
if: ${{ steps.check-artifact.outputs['has-docs'] == true }}
49+
if: ${{ steps.check-artifact.outputs.has-docs == 'true' }}
5350
uses: actions/download-artifact@v4
5451
with:
5552
name: artifact-docs
@@ -58,7 +55,7 @@ jobs:
5855
path: packages/docs
5956

6057
- name: Verify dist directory exists
61-
if: ${{ steps.check-artifact.outputs['has-docs'] == true }}
58+
if: ${{ steps.check-artifact.outputs.has-docs == 'true' }}
6259
run: |
6360
ls -la packages/docs
6461
if [ ! -d "packages/docs/dist" ]; then
@@ -69,7 +66,7 @@ jobs:
6966
7067
# not the official version, so be careful when updating
7168
- name: Deploy to Cloudflare Pages
72-
if: ${{ steps.check-artifact.outputs['has-docs'] == true }}
69+
if: ${{ steps.check-artifact.outputs.has-docs == 'true' }}
7370
uses: AdrianGonz97/refined-cf-pages-action@6c0d47ff7c97c48fa702b6d9f71f7e3a7c30c7d8
7471
with:
7572
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@@ -79,5 +76,5 @@ jobs:
7976
githubToken: ${{ secrets.GITHUB_TOKEN }}
8077

8178
- name: Skip message when no docs artifact
82-
if: ${{ steps.check-artifact.outputs['has-docs'] != true }}
79+
if: ${{ steps.check-artifact.outputs.has-docs != 'true' }}
8380
run: echo "No docs artifact found, skipping deployment"

0 commit comments

Comments
 (0)