Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kahboom committed May 31, 2024
1 parent f3a3fb9 commit c094c15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ name: Cross Browser End-to-End Testing (Cypress) 🚀
on:
push:
branches:
- main
- '**'
pull_request:
types: [opened, synchronize, reopened]
branches:
- '**'
types: [opened, reopened, synchronize]
schedule:
- cron: '0 2 * * FRI'

jobs:
cypress-run:
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 30

services:
docker:
Expand All @@ -26,21 +28,12 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Create Docker secrets
run: |
echo ${{ secrets.CYPRESS_RECORD_KEY }} | docker secret create cypress_record_key -
echo ${{ secrets.GITHUB_TOKEN }} | docker secret create github_token -
- name: Build and run Docker Compose 🐳
env:
NODE_ENV: production
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN: https://rekor.sigstore.dev
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: docker-compose up --build -d

- name: Wait for services to start ⏱️
Expand Down
15 changes: 2 additions & 13 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,11 @@ services:
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN: https://rekor.sigstore.dev
depends_on:
- nextjs
secrets:
- source: cypress_record_key
target: cypress_record_key
- source: github_token
target: github_token
volumes:
- ./artifacts/electron/videos:/e2e/cypress/videos
- ./artifacts/electron/screenshots:/e2e/cypress/screenshots
environment:
- CYPRESS_BASE_URL=http://nextjs:3000
- CYPRESS_RECORD_KEY_FILE=/run/secrets/cypress_record_key
- GITHUB_TOKEN_FILE=/run/secrets/github_token
- CYPRESS_RECORD_KEY=${CYPRESS_RECORD_KEY}
- GITHUB_TOKEN=${GITHUB_TOKEN}
command: npx cypress run

secrets:
cypress_record_key:
external: true
github_token:
external: true

0 comments on commit c094c15

Please sign in to comment.