Skip to content

Commit 3aaeed0

Browse files
authored
Merge pull request #5185 from MikeMcC399/gha/docker
fix GHA docker example
2 parents 6c95189 + 326aad3 commit 3aaeed0

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

docs/guides/continuous-integration/github-actions.mdx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,18 @@ the above example to select Chrome instead of the default browser Electron, add
154154
For more examples, see the action's
155155
[Browser](https://github.com/cypress-io/github-action#browser) section.
156156

157-
## Testing in Chrome and Firefox with Cypress Docker Images
157+
## Testing with Cypress Docker Images
158158

159159
GitHub Actions provides the option to specify a container image for the job.
160160
Cypress offers various
161161
[Docker Images](https://github.com/cypress-io/cypress-docker-images) for running
162162
Cypress locally and in CI.
163163

164-
Below we add the `container` attribute using a
164+
Below we extend the previous example by adding the `container` attribute using a
165165
[Cypress Docker Image](https://github.com/cypress-io/cypress-docker-images)
166-
built with Google Chrome and Firefox. For example, this allows us to run the
167-
tests in Firefox by passing the `browser: firefox` attribute to the
168-
[Cypress GitHub Action](https://github.com/marketplace/actions/cypress-io).
166+
built with Google Chrome `107`. This allows us to fix our test to a specific
167+
browser version without any influence due to browser version changes in the
168+
GitHub runner image.
169169

170170
```yaml
171171
name: Cypress Tests using Cypress Docker Image
@@ -175,18 +175,16 @@ on: push
175175
jobs:
176176
cypress-run:
177177
runs-on: ubuntu-22.04
178-
container: cypress/browsers:node12.18.3-chrome87-ff82
178+
container: cypress/browsers:node18.12.0-chrome107
179179
steps:
180180
- name: Checkout
181181
uses: actions/checkout@v3
182-
183-
# Install NPM dependencies, cache them correctly
184-
# and run all Cypress tests
185182
- name: Cypress run
186183
uses: cypress-io/github-action@v5
187184
with:
188-
# Specify Browser since container image is compiled with Firefox
189-
browser: firefox
185+
build: npm run build
186+
start: npm start
187+
browser: chrome
190188
```
191189

192190
## Caching Dependencies and Build Artifacts

0 commit comments

Comments
 (0)