Lorenm #18
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: Shopify Lighthouse CI | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| jobs: | |
| get-environment: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| environment: ${{ steps.get_environment.outputs.environment }} | |
| steps: | |
| - id: get_environment | |
| name: Get Environment | |
| run: | | |
| target_branch="${{ github.event.pull_request.base.ref }}" | |
| echo "Target branch: $target_branch" | |
| if [[ $target_branch = "develop" ]] | |
| then | |
| echo "environment=develop" >> $GITHUB_OUTPUT | |
| elif [[ $target_branch = "master" ]] | |
| then | |
| echo "environment=main" >> $GITHUB_OUTPUT | |
| else | |
| echo "error: Could not determine environment" | |
| exit 1 | |
| fi | |
| lighthouse-check: | |
| runs-on: ubuntu-latest | |
| needs: ["get-environment"] | |
| environment: | |
| name: ${{ needs.get-environment.outputs.environment }} | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Lighthouse | |
| uses: shopify/lighthouse-ci-action@v1.2.2 | |
| with: | |
| access_token: ${{ secrets.SHOP_ACCESS_TOKEN }} | |
| store: ${{ secrets.SHOP_STORE }} | |
| password: ${{ secrets.SHOP_PASSWORD }} | |
| lhci_github_app_token: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | |
| product_handle: adult-baseball-jersey-henley | |
| collection_handle: all |