Send Authorization header on Scratch project save #5808
Workflow file for this run
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: CI-CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "**" | |
| pull_request: | |
| branches: | |
| - "**" | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Check for SCSS changes | |
| uses: dorny/paths-filter@v3 | |
| id: changes | |
| with: | |
| filters: | | |
| scss: | |
| - 'src/**/*.scss' | |
| - '.stylelintrc*' | |
| - 'stylelint.config.*' | |
| - 'package.json' | |
| - name: Cache dependencies | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "yarn" | |
| registry-url: "https://npm.pkg.github.com" | |
| # Defaults to the user or organization that owns the workflow file | |
| scope: "@RaspberryPiFoundation" | |
| - name: Install code | |
| run: yarn install --immutable | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: eslint | |
| run: yarn lint | |
| - name: stylelint | |
| if: steps.changes.outputs.scss == 'true' | |
| run: yarn stylelint | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v1 | |
| - name: Cache dependencies | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "yarn" | |
| registry-url: "https://npm.pkg.github.com" | |
| # Defaults to the user or organization that owns the workflow file | |
| scope: "@RaspberryPiFoundation" | |
| - name: Install code | |
| run: yarn install --immutable | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run tests | |
| run: yarn run test --coverage --maxWorkers=4 --workerThreads=true --reporters=default --reporters=jest-junit --reporters=jest-github-actions-reporter | |
| env: | |
| JEST_JUNIT_OUTPUT_DIR: ./coverage/ | |
| REACT_APP_API_ENDPOINT: http://localhost:3009 | |
| - name: Record coverage | |
| run: ./.github/workflows/record_coverage | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| test-cypress: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v1 | |
| - name: Cache dependencies | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "yarn" | |
| registry-url: "https://npm.pkg.github.com" | |
| # Defaults to the user or organization that owns the workflow file | |
| scope: "@RaspberryPiFoundation" | |
| - name: Install code | |
| run: yarn install --immutable | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Cypress run | |
| uses: cypress-io/github-action@v7 | |
| with: | |
| install: false | |
| start: | | |
| yarn start | |
| wait-on: "http://localhost:3011" | |
| quiet: true | |
| config-file: cypress.config.mjs | |
| browser: chrome | |
| env: | |
| REACT_APP_API_ENDPOINT: "https://test-editor-api.raspberrypi.org" | |
| PUBLIC_URL: "http://localhost:3011" | |
| ASSETS_URL: "http://localhost:3011" | |
| REACT_APP_PLAUSIBLE_SOURCE: "" | |
| REACT_APP_ALLOWED_IFRAME_ORIGINS: "http://localhost:3011" | |
| - name: Archive cypress artifacts | |
| uses: actions/upload-artifact@v4.6.0 | |
| if: failure() | |
| with: | |
| name: cypress-artifacts | |
| path: | | |
| cypress/screenshots | |
| deploy-tag: | |
| if: github.ref_type == 'tag' | |
| uses: ./.github/workflows/deploy.yml | |
| with: | |
| base_url: https://editor-static.raspberrypi.org | |
| assets_url: https://editor-static.raspberrypi.org | |
| environment: production | |
| prefix: releases | |
| react_app_api_endpoint: https://editor-api.raspberrypi.org | |
| react_app_authentication_url: https://auth-v1.raspberrypi.org | |
| react_app_base_url: "" | |
| react_app_google_tag_manager_id: GTM-5FWFWFJ | |
| react_app_plausible_data_domain: "editor.raspberrypi.org" | |
| react_app_plausible_source: "https://plausible.io/js/script.js" | |
| react_app_sentry_dsn: https://a6d7b79c7a474a6499ace73acf792a83@o17504.ingest.sentry.io/4504055099621376 | |
| react_app_sentry_env: production | |
| react_app_allowed_iframe_origins: "https://editor.raspberrypi.org,https://editor-static.raspberrypi.org" | |
| secrets: inherit | |
| deploy-main: | |
| if: github.ref_type == 'branch' && github.ref_name == 'main' | |
| needs: [lint, test, test-cypress] | |
| uses: ./.github/workflows/deploy.yml | |
| with: | |
| environment: staging | |
| react_app_base_url: "" | |
| react_app_sentry_env: staging | |
| secrets: inherit | |
| deploy-branch: | |
| if: github.ref_type == 'branch' && github.ref_name != 'main' | |
| uses: ./.github/workflows/deploy.yml | |
| with: | |
| environment: previews/${{ github.ref_name }} | |
| secrets: inherit |