Skip to content

feat: add screenshots generation in cd #19

feat: add screenshots generation in cd

feat: add screenshots generation in cd #19

Workflow file for this run

name: cd
permissions:
contents: write
on:
push:
branches:
- main
repository_dispatch:
types: [ 'deploy' ]
workflow_dispatch:
jobs:
cd:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install
run: npm ci
- name: Test
run: npm test
- name: Build
run: npm run build
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 23
extra_plugins: |
@semantic-release/changelog@6
@semantic-release/git@10
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
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:

Check failure on line 61 in .github/workflows/cd.yml

View workflow run for this annotation

GitHub Actions / cd

Invalid workflow file

The workflow is not valid. .github/workflows/cd.yml (Line: 61, Col: 9): Unexpected value 'output' .github/workflows/cd.yml (Line: 69, Col: 14): Unrecognized named-value: 'GITHUB_TOKEN'. Located at position 1 within expression: GITHUB_TOKEN
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