fix: restore search state on browser back/forward navigation #6273
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 👓 Review Auto | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| - "!renovate/**" | |
| - "!dependabot/**" | |
| - "!master" | |
| - "!main" | |
| concurrency: | |
| cancel-in-progress: true | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }} | |
| jobs: | |
| build-app: | |
| environment: build-review-auto | |
| outputs: | |
| tags: ${{ steps.meta.outputs.tags }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: ⏬ Checkout code repository | |
| uses: actions/checkout@v4 | |
| - name: 📌 Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ vars.REGISTRY_URL }}/${{ vars.PROJECT_NAME }}/${{ github.event.repository.name }}/app | |
| tags: | | |
| type=sha,prefix=persist-,format=long,enable=${{ | |
| github.ref_name == 'dev' || | |
| github.ref_name == 'develop' || | |
| github.ref_name == 'preprod' || | |
| github.ref_name == 'main' || | |
| github.ref_name == 'master' | |
| }},priority=840 | |
| type=sha,prefix=sha-,format=long,priority=890 | |
| type=ref,event=branch,priority=600 | |
| - name: Env | |
| id: env | |
| uses: socialgouv/kontinuous/.github/actions/env@v1 | |
| - name: 📦 Build and push Docker image for app | |
| uses: socialgouv/workflows/actions/buildkit@v1 | |
| with: | |
| context: "." | |
| dockerfile: "Dockerfile" | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| registry: "${{ vars.REGISTRY_URL }}" | |
| registry-username: "${{ secrets.REGISTRY_USERNAME }}" | |
| registry-password: "${{ secrets.REGISTRY_PASSWORD }}" | |
| buildkit-cert-ca: "${{ secrets.BUILDKIT_CERT_CA }}" | |
| buildkit-cert: "${{ secrets.BUILDKIT_CERT }}" | |
| buildkit-cert-key: "${{ secrets.BUILDKIT_CERT_KEY }}" | |
| buildkit-svc-count: ${{ vars.BUILDKIT_SVC_COUNT }} | |
| buildkit-daemon-address: ${{ vars.BUILDKIT_DAEMON_ADDRESS }} | |
| secrets: | | |
| SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} | |
| ELASTICSEARCH_TOKEN_API=${{ secrets.ELASTICSEARCH_TOKEN_API }} | |
| ELASTICSEARCH_URL=${{ secrets.ELASTICSEARCH_URL }} | |
| build-args: | | |
| NEXT_PUBLIC_CDTN_ENV=development | |
| NEXT_PUBLIC_BUCKET_FOLDER=preview | |
| NEXT_PUBLIC_BUCKET_SITEMAP_FOLDER=sitemap | |
| NEXT_PUBLIC_BUCKET_URL=https://cdtn-dev-public.s3.gra.io.cloud.ovh.net | |
| NEXT_PUBLIC_PIWIK_SITE_ID=3 | |
| NEXT_PUBLIC_PIWIK_URL=https://matomo.fabrique.social.gouv.fr | |
| NEXT_PUBLIC_COMMIT=${{ github.sha }} | |
| NEXT_PUBLIC_SITE_URL=https://${{ steps.env.outputs.subdomain }}.ovh.fabrique.social.gouv.fr | |
| NEXT_PUBLIC_SENTRY_DSN=${{ secrets.PUBLIC_SENTRY_DSN }} | |
| NEXT_PUBLIC_SENTRY_RELEASE=${{ steps.env.outputs.branchSlug32 }} | |
| NEXT_PUBLIC_SENTRY_ORG=incubateur | |
| NEXT_PUBLIC_SENTRY_ENV=dev | |
| NEXT_PUBLIC_SENTRY_PROJECT=fabnum-code-du-travail-numerique | |
| NEXT_PUBLIC_SENTRY_URL=https://sentry2.fabrique.social.gouv.fr | |
| NEXT_PUBLIC_ES_INDEX_PREFIX=cdtn-preprod | |
| NEXT_PUBLIC_BRANCH_NAME_SLUG=${{ steps.env.outputs.branchSlug32 }} | |
| NEXT_PUBLIC_ENABLE_AB_TESTING=false | |
| kontinuous: | |
| needs: [build-app] | |
| name: "Deploy on Kubernetes 🐳" | |
| uses: socialgouv/workflows/.github/workflows/use-ks-gh-review-auto-atlas.yaml@v1 | |
| secrets: inherit | |
| lighthouse: | |
| name: Lighthouse audit | |
| runs-on: ubuntu-latest | |
| needs: [kontinuous] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Env | |
| id: env | |
| uses: socialgouv/kontinuous/.github/actions/env@v1 | |
| - name: Set env | |
| run: | | |
| echo "SITE_URL=https://${{ steps.env.outputs.subdomain }}.ovh.fabrique.social.gouv.fr" >> $GITHUB_ENV | |
| - name: Audit URLs using Lighthouse | |
| uses: treosh/lighthouse-ci-action@v12 | |
| env: | |
| LHCI_BASE_URL: ${{ env.SITE_URL }} | |
| with: | |
| configPath: ./lighthouserc.cjs | |
| temporaryPublicStorage: true | |
| uploadArtifacts: true | |
| e2e: | |
| name: End-to-end testing | |
| runs-on: ubuntu-latest | |
| needs: [ kontinuous ] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .node-version | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Install dependencies | |
| run: | | |
| pnpm install --frozen-lockfile | |
| - name: Install Playwright binary | |
| run: | | |
| pnpm --filter @cdt/frontend test:e2e:install | |
| - name: Env | |
| id: env | |
| uses: socialgouv/kontinuous/.github/actions/env@v1 | |
| - name: Set env | |
| run: | | |
| echo "SITE_URL=https://${{ steps.env.outputs.subdomain }}.ovh.fabrique.social.gouv.fr" >> $GITHUB_ENV | |
| - name: Run test e2e | |
| run: | | |
| TEST_BASEURL=${{ env.SITE_URL }} pnpm test:e2e -- --project=chromium | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: packages/code-du-travail-frontend/playwright-report/ | |
| retention-days: 7 |