Add local Selenium Grid setup and configuration guide #35
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: Build Verification | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| branches: | |
| - '**' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build Website | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write # Required to create issues | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: yarn | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Build website | |
| id: build | |
| run: yarn build | |
| continue-on-error: true | |
| - name: Create issue on build failure | |
| if: steps.build.outcome == 'failure' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const buildUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; | |
| const issueTitle = `Build Failed: ${process.env.GITHUB_REF_NAME}`; | |
| const issueBody = `## Build Failure Report | |
| The website build has failed. | |
| **Branch:** ${process.env.GITHUB_REF_NAME} | |
| **Commit:** ${process.env.GITHUB_SHA} | |
| **Workflow Run:** ${buildUrl} | |
| **Triggered by:** ${process.env.GITHUB_ACTOR} | |
| Please check the workflow logs for details on the build failure. | |
| `; | |
| // Check if there's already an open issue for this | |
| const issues = await github.rest.issues.listForRepo({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'open', | |
| labels: 'build-failure', | |
| per_page: 100 | |
| }); | |
| const existingIssue = issues.data.find(issue => | |
| issue.title === issueTitle | |
| ); | |
| if (existingIssue) { | |
| // Comment on existing issue | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: existingIssue.number, | |
| body: `Build failed again.\n\n**New Run:** ${buildUrl}\n**Commit:** ${process.env.GITHUB_SHA}` | |
| }); | |
| console.log(`Commented on existing issue #${existingIssue.number}`); | |
| } else { | |
| // Create new issue | |
| try { | |
| const issue = await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: issueTitle, | |
| body: issueBody, | |
| labels: ['build-failure'], | |
| assignees: ['copilot'] | |
| }); | |
| console.log(`Created issue #${issue.data.number}`); | |
| } catch (error) { | |
| // If assigning to 'copilot' fails, create issue without assignee | |
| console.log(`Failed to assign to copilot: ${error.message}`); | |
| const issue = await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: issueTitle, | |
| body: issueBody, | |
| labels: ['build-failure'] | |
| }); | |
| console.log(`Created issue #${issue.data.number} without assignee`); | |
| } | |
| } | |
| - name: Fail the workflow if build failed | |
| if: steps.build.outcome == 'failure' | |
| run: exit 1 |