CI: Check data.json exists before deploying page (#21)

This commit is contained in:
Rémi Verschelde
2025-11-25 23:33:49 +01:00
committed by GitHub
parent 3d4082e25d
commit 9b4f812556
2 changed files with 12 additions and 0 deletions

View File

@@ -39,13 +39,24 @@ jobs:
GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check that data.json was created
id: check_data
run: |
if [ -f "out/data.json" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Archive production artifacts
if: steps.check_data.outputs.exists == 'true'
uses: actions/upload-artifact@v4
with:
name: web-static
path: out
- name: Deploy to GitHub Pages 🚀
if: steps.check_data.outputs.exists == 'true'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages

1
out.log Normal file
View File

@@ -0,0 +1 @@
exists=false