From 75edd09ef6817d3d45cfa3631eea32388ece29e8 Mon Sep 17 00:00:00 2001 From: Vincent Hardouin Date: Sun, 10 Mar 2024 16:42:13 +0100 Subject: [PATCH] feat: add screenshots generation in cd --- .github/workflows/cd.yml | 18 +++++++++++++++++- docs/screenshots/.gitkeep | 0 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/screenshots/.gitkeep diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 650f268..a472378 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -53,4 +53,20 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./dist - cname: metro-travel.vincenthardouin.dev \ No newline at end of file + cname: metro-travel.vincenthardouin.dev + + - name: Generate Screenshots + id: screenshots + if: steps.semantic.outputs.new_release_published == 'true' && steps.semantic.outputs.new_release_patch_version == '0' + output: + screenshots_generated: ${{ steps.screenshots.outputs.screenshots_generated }} + run: (npm start &); npm run screenshots && echo "screenshots_generated=true" >> $GITHUB_OUTPUT + + - name: Commit & push screenshots + if: steps.screenshots.outputs.screenshots_generated == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git add docs/ + && git commit -m "docs: include screenshots for version ${{steps.semantic.outputs.new_release_published}} [skip ci]" + && git push https://x-access-token:${{GITHUB_TOKEN}}/github.com/${{GITHUB_REPOSITORY}}.git HEAD:refs/heads/main \ No newline at end of file diff --git a/docs/screenshots/.gitkeep b/docs/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29