Skip to content

Commit 9b4f812

Browse files
authored
CI: Check data.json exists before deploying page (#21)
1 parent 3d4082e commit 9b4f812

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,24 @@ jobs:
3939
GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }}
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141

42+
- name: Check that data.json was created
43+
id: check_data
44+
run: |
45+
if [ -f "out/data.json" ]; then
46+
echo "exists=true" >> $GITHUB_OUTPUT
47+
else
48+
echo "exists=false" >> $GITHUB_OUTPUT
49+
fi
50+
4251
- name: Archive production artifacts
52+
if: steps.check_data.outputs.exists == 'true'
4353
uses: actions/upload-artifact@v4
4454
with:
4555
name: web-static
4656
path: out
4757

4858
- name: Deploy to GitHub Pages 🚀
59+
if: steps.check_data.outputs.exists == 'true'
4960
uses: JamesIves/github-pages-deploy-action@v4
5061
with:
5162
branch: gh-pages

out.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exists=false

0 commit comments

Comments
 (0)